Module · Queues
First-In, First-Out — elements enter at the rear and exit from the front.
Size: 3/6 · Enqueue: O(1) · Dequeue: O(1)
Queue initialized. Front is left, rear is right (FIFO).
Enqueue
Dequeue
Peek
A queue follows FIFO — First-In, First-Out. Elements join at the rear and leave from the front, like a line of people waiting.
Queues model task schedulers, print spoolers, and breadth-first search. Enqueue and dequeue both run in constant time.