AlgoViz
← Back to the lesson
🧩 Puzzle · Apply Stack & Queue

Next out

Same sequence of operations, but is it a stack or a queue? On every OUT, click the element you think leaves. A stack removes the newest (LIFO); a queue removes the oldest (FIFO). Get the discipline right and you'll never guess wrong.

queueFIFO — first in, first out
empty
Queue = FIFO. On each OUT, click the element that gets dequeued.
On each OUT, click the element that leaves. Oldest first.no misses