Stack — last in, first out

Like an editor's undo history: Undo takes back your latest change first.

↓ in and ↑ out, both at the top

Queue — first in, first out

Like a printer queue: the document sent first is printed first.

← out at the frontin at the back ←

Operations so far

    The names programmers use: a stack has push and pop, a queue has enqueue and dequeue. Both hold at most 8 items in this demo.

    AI-generated interactive demo.