Queue

noun

say it: “KYOO” /kju/

A first-in, first-out collection: items join at the back and leave from the front.

What is a queue?

A queue keeps items first in, first out, like the line at a coffee shop: items enqueue at the back and dequeue from the front. Built on a linked list with a head and a tail, or on a ring buffer, every operation is O(1). Print jobs, support tickets and background tasks all wait in queues.

In a sentence

  • “Print jobs wait in a queue, so the first one sent is the first one printed.”

Level: Apprentice · More Data Structures terms at this level

Updated

In other subjects