Introduction
Imagine waiting in line at a coffee shop. The person who arrives first gets served first. This problem of managing order fairly and predictably is what queues solve in computing and everyday life.
Imagine a line at a bakery where customers wait to buy bread. The first customer to arrive is the first to be served, and new customers join at the end of the line. No one can cut in front, so everyone is served in the order they arrived.
┌─────────────┐ │ Queue Front │ ← Remove here (oldest item) ├─────────────┤ │ Item 1 │ │ Item 2 │ │ Item 3 │ │ Item 4 │ ├─────────────┤ │ Queue Rear │ ← Add here (newest item) └─────────────┘