Stack data structure implemented with a linked list for efficient O(1) push and pop operations. Supports standard stack operations such as push, pop, and peek.
The type of elements held in the stack.
Gets the number of elements in the stack.
The size of the stack.
Clears all elements from the stack, resetting it to an empty state.
Checks if the stack is empty.
True if the stack is empty, otherwise false.
Returns the element at the top of the stack without removing it.
The value at the top, or undefined if the stack is empty.
Removes and returns the element at the top of the stack.
The value of the popped element, or undefined if the stack is empty.
Adds an element to the top of the stack.
The value to add.
Stack data structure implemented with a linked list for efficient O(1) push and pop operations. Supports standard stack operations such as push, pop, and peek.