See Also: Stack Members
For the generic version of this collection, see Stack`1.
Stack is implemented as a circular buffer.
The capacity of a Stack is the number of elements the Stack can hold. As elements are added to a Stack, the capacity is automatically increased as required through reallocation.
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.