Stack
A Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). LIFO implies that the element that is inserted last, comes out first and FILO implies that the element that is inserted first, comes out last.
Ultify's stack is a wrapper around Javascript array push/pop with a standard stack interface.
Operations
- Push: Adds an element to the top of the stack.
- Pop: Removes the top element from the stack.
- Peek: Returns the top element without removing it.
- Clear: Empty the stack.
- IsEmpty: Checks if the stack is empty.
- toArray: Convert stack to an array.