Use it for undo, nested syntax, and unresolved work whose newest item matters first.
Stacks, Queues, and Deques
5 chapters · 11 challenges · The Stacked Ruins
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What are stacks, queues, and deques?
These structures control which stored item may leave next. A stack removes the newest item, a queue removes the oldest, and a deque allows both ends.
Think of plates and a waiting line. You take the top plate from a stack, but the person waiting longest leaves a queue first. The removal rule is the structure's entire power.
One storage rule determines the next item your algorithm can process.
Use it for fair arrival order and breadth-first exploration.
Remove dominated candidates so the useful frontier stays small.
Last opened, first closed
LIFO
0/2 completePractice LIFO through 2 visual expeditions.
FIFO
0/2 completePractice FIFO through 2 visual expeditions.
Monotonic Stack
0/3 completePractice monotonic stack through 3 visual expeditions.
Monotonic Deque
0/2 completePractice monotonic deque through 2 visual expeditions.
Expression Parsing
0/2 completePractice expression parsing through 2 visual expeditions.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.