Step 1/0
Complexity
Best:O(1)
Average:O(1)
Worst:O(1)
Space:O(n)
Description
A Last-In-First-Out (LIFO) data structure. Elements are added and removed from the same end (top).
When to use
Function call management, undo operations, expression evaluation, backtracking algorithms (DFS), and browser history.