Queues

A queue is a type of data structure where the first item you add to the data structure will be the first item that gets removed from the data structure. It is thus referred to as a FIFO (first in, first out) structure. Queues are generally implemented in two ways, the first of which, arrays, will be covered in this section. They can also be easily implemented by way of linked lists. Queues have two operations that can be performed on them: enqueueing (adding an item to the queue) and dequeueing (removing the least-recently added item from the queue).