See Also: Stack Members
For the generic version of this collection, see Stack`1.
Stack is implemented as a circular buffer.
If Stack.Count is less than the capacity of the stack, Stack.Push(object) is an O(1) operation. If the capacity needs to be increased to accommodate the new element, Stack.Push(object) becomes an O(n) operation, where n is Stack.Count. Stack.Pop is an O(1) operation.
Stack accepts null as a valid value and allows duplicate elements.