Stack

Description

The Stack class implements an object that is a stack of elements.

Comment

Principle of stack operation is First in - Last out. Elements are always added to the beginning of a stack and are removed from the beginning. For working with elements, various methods of stack are used: Peek, Pop, Push. To check presence of element in stack, use the Contains method.

Class object properties inherited from ICollection

  Property name Brief description
Count The Count property returns the number of array elements.

Class object methods inherited form IStack

  Method name Brief description
Clear The Clear method clears the stack.
Clone The Clone method creates a copy of the stack.
Contains The Contains method checks if an element exists in the stack.
Peek The Peek method extracts value of the element placed to the stack as the last one without removing the element itself.
Pop The Pop method extracts value of the element placed to the stack as the last one with removing the element itself.
Push The Push method puts the specified value to the beginning of the stack.
ToArray The ToArray method converts a stack into a standard array.

Class object methods inherited from ICollection

  Method name Brief description
CopyTo The CopyTo method copies the collection into an array.

See also:

Collections Assembly Classes