Interactive Queue Visualizer

Enqueue, dequeue, and explore how a FIFO queue works

FIFO — First In, First Out Items join at the back and leave from the front, just like a real queue!
Size: 0/8
Front (dequeue) Back (enqueue)
Queue is empty

How a Queue Works

enqueue(item) — Adds an item to the back of the queue.

dequeue() — Removes and returns the item at the front. The item that has been waiting the longest leaves first.

peek() — Returns the front item without removing it.

Real-world examples: printer job queues, CPU task scheduling, customers waiting in line.

Operation History

No operations yet