Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 840 Bytes

queues.md

File metadata and controls

33 lines (20 loc) · 840 Bytes

Queues

A queue data structure

  • is a collection of entities
    • that are maintained in a sequence

Modification or Addition of entities

  • at one end of the sequence the removal of entities from the other end of the sequence.

By convention:

Back/Tail/Rear of the Queue >>

  • The end of the sequence at which elements are added

Head/Front of the Queue >>

  • The end at which elements are removed

Analogously to the words used when people line up to wait for goods or services.

enqueue

  • The operation of adding an element to the rear of the queue

dequeue

  • The operation of removing an element from the front

Other operations may also be allowed:

Often including a peek or front operation

  • that returns the value of the next element
    • to be dequeued without dequeuing it.