![]() ![]() Initializes a new instance of the Stack class that is empty and has the default initial capacity. Stack accepts null as a valid value and allows duplicate elements. If the capacity needs to be increased to accommodate the new element, Push becomes an O(n) operation, where n is Count. If Count is less than the capacity of the stack, Push is an O(1) operation. For more information, see Non-generic collections shouldn't be used on GitHub. ![]() Instead, we recommend that you use the generic class. We don't recommend that you use the Stack class for new development. As elements are added to a Stack, the capacity is automatically increased as required through reallocation. The capacity of a Stack is the number of elements the Stack can hold. ' This code produces the following output. Public Shared Sub PrintValues(m圜ollection As IEnumerable) Displays the properties and values of the Stack.Ĭonsole::WriteLine( "\tCount: ", myStack.Count)Ĭonsole.Write(ControlChars.Tab
0 Comments
Leave a Reply. |