A Queue is a linear data structure that operates under the FIFO (First-In, First-Out) principle. Unlike a stack which operates at a single end (TOP), a queue operates across two distinct ends:
- REAR (Tail): The end where new elements are inserted (Enqueue operation).
- FRONT (Head): The end where existing elements are removed (Dequeue operation).
Core Primitive Operations:
- `enqueue(item)`: Inserts a new element at the REAR of the queue.
- `dequeue()`: Removes and returns the element at the FRONT of the queue. If the queue is empty, triggers Queue Underflow.
- `peek()` / `front()`: Returns the value of the front element *without* removing it.
- `isEmpty()`: Returns `True` if the queue contains zero elements, `False` otherwise.