class Stack<T>
{
private T[] items;
private int idx;
public Stack(int size)
{
items = new T[size];
idx = 0;
}
public void Push(T x)
{
items[idx++] = x;
}
public T pop()
{
return items[--idx];
}
}
{
private T[] items;
private int idx;
public Stack(int size)
{
items = new T[size];
idx = 0;
}
public void Push(T x)
{
items[idx++] = x;
}
public T pop()
{
return items[--idx];
}
}