← CS 302 Home

Stacks — Interactive

Push and pop values to see LIFO behavior with two implementations side by side. Try the balanced parentheses checker to see stacks in action.

Normal
0
Size
10
Capacity
Last Op
Insight: Same LIFO behavior, different underlying storage. Array gives O(1) amortized push with cache-friendly memory. Linked list gives O(1) worst-case push with no capacity limit.
Array Implementation
Linked List Implementation
Element
Pushed
Popping
Peeked