public void Push(int i) { if (position == size) { int[] old = stack; stack = new int[size * 2]; size = stack.Length; Array.Copy(old, 0, stack, 0, old.Length); } stack[position++] = i; }