O'Reilly logo

Everyday Data Structures by William Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Queues: FIFO Collections

A queue is an abstract data structure that serves as a linear collection of objects that are inserted and removed based on the first-in first-out (FIFO) principle. The two most notable operations of a queue are enqueue, which adds objects to the tail or back of the collection, and dequeue, which removes objects from the head or front of the collection. The following figure demonstrates the queue data structure as well as these two basic operations. Other common operations include peek, empty, and full, all of which will be examined later in this chapter:

Queues: FIFO Collections

Queues are very similar to stacks and they share some of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required