Skip to content
DSA Visualizerpreview

Stack

Push and pop at the same end: the last value in is the first value out.

O(1) per operation time · O(n) space

Operations3, 8, 5, pop, peek, 7, pop, pop

Start with an empty stack.

Empty stack.
  • compare
  • swap or write
  • settled

1 / 12

Speed

Space play · ← → step · Home End jump · drag the strip to scrub