Start here · Essential guide
Stack Operations in Data Structures
A guide to stack operations in data structures: push, pop, peek, and isEmpty, how each works, their time complexity, and overflow and underflow.
Data Structures
Push, pop and other stack operations, why top starts at -1 and where stacks are used.
Start here · Essential guide
A guide to stack operations in data structures: push, pop, peek, and isEmpty, how each works, their time complexity, and overflow and underflow.
Ten common uses of a stack in programming and computing, from function calls and expression evaluation to undo history and browser back buttons.
What an abstract data type (ADT) is, how it differs from a data structure, and how a stack works as an ADT with push, pop, and peek operations.
Why the top index of an array-based stack starts at -1 instead of 0, how that value marks an empty stack, and how push and pop depend on that value.
Related topics