Introduction
Imagine waiting in line to buy a ticket. The first person who arrives is the first to be served. This problem of managing order is what queues solve in computing, ensuring things happen in the right sequence.
Think of a line at a coffee shop. Customers join the line at the back and the barista serves the customer at the front first. No one can cut in line or skip ahead.
┌─────────────┐ │ Queue │ ├─────────────┤ │ Front │ ← Dequeue removes here │ [Item A] │ │ [Item B] │ │ [Item C] │ │ Back │ ← Enqueue adds here └─────────────┘