Algomination
Sorting
Searching
Data Structures
About
Contact
All data structures
Stack
Ops O(1)
Space O(n)
A LIFO structure — push adds to the top, pop removes the top, peek inspects it. All O(1).
Push
Pop
Peek
Clear
Random
5
← top
7
3
3 / 8 elements
Push, pop, or peek to manipulate the stack (LIFO — last in, first out).
Top of stack
Peek