Queues are, exactly as the name states, queues of elements. A linked list is addressed by two pointers-one for the top element and one for the tail element. By nature, queues are a FIFO (First In First Out) arrangement of data, meaning that the element that was pushed first is to be popped first, too. It is totally up to you to decide where the queue starts and where it ends-whether top is the beginning or the end of a queue, and the same for tail. Should we want to convert the example of a linked list we used in this chapter to a queue, we would only need to add a list_tail pointer.
Deques are double-ended queues, which means that elements may be pushed into the queue either at the top element or at the tail element depending on the algorithm. The same is true for popping elements from the queue.