What are queues?

A queue is like a line of people waiting for something fun, just like when you and your friends wait at the ice cream truck.

Imagine it's a sunny day, and everyone wants chocolate ice cream. You all stand in a straight line, that’s a queue! The first person gets their ice cream, then the next one, and so on. No one jumps ahead unless they’re really excited about sprinkles.

How Queues Work

In a queue, people wait in order. The first person to get there goes first, just like when you line up for the slide at the park. If someone arrives later, they go at the end of the line, that’s called joining the queue.

When it's your turn, you move forward, that’s called leaving the queue. Sometimes, if you're really hungry and want to get ice cream faster, you might try to sneak ahead, but usually, everyone is happy to wait in order!

Queues are everywhere: at school, on a bus, or even when your toys are waiting for their turn to be played with!

Take the quiz →

Examples

  1. A bakery has a queue where people wait for their turn to buy bread.
  2. Students line up outside the classroom before entering.
  3. You join a queue at the supermarket checkout.

Ask a question

See also

Discussion

Recent activity

Categories: Math · queues· lines· data structures