Stacks & Queues intro time O(1) amortised space O(n)
Queue — Enqueue & Dequeue
A queue adds at one end and removes from the other. The value that has waited longest is always served first — first in, first out, exactly like a line of people.
A queue: values join at the back and leave from the front.
1 / 10
Practice
Machine twin: /dsa-viz-v2/queue-enqueue-dequeue.json — the full deterministic run as structured data.