What is Queue?
A data structure that follows First-In-First-Out (FIFO) ordering, where elements are added at the rear and removed from the front.
Queues model real-world waiting lines. Enqueue adds to the back, dequeue removes from the front. Implementations include array-based (circular buffer) and linked-list-based queues. Priority queues dequeue by priority rather than insertion order.
Queues are used in breadth-first search, task scheduling, print spooling, request handling (web servers), and message queues (RabbitMQ, SQS). Double-ended queues (deques) allow insertion and removal at both ends.