A Last-In-First-Out (LIFO) stack data structure.
T - The type of elements stored in the stack
Private
Checks if the stack is empty.
True if the stack contains no elements, false otherwise
Returns the element at the top of the stack without removing it.
The element at the top of the stack
Error if the stack is empty
Removes the element from the top of the stack.
Adds an element to the top of the stack.
The value to add
Returns the number of elements in the stack.
The size of the stack
A Last-In-First-Out (LIFO) stack data structure.
Typeparam
T - The type of elements stored in the stack