Source: 📖 Problem Solving with Algorithms and Data Structures using Python 4.10
A queue is a Fist In First Out (FIFO) ordered linear data structure. It has a front and a rear – new items are added to the rear of the queue, and existing items are popped from the front of the queue. Because every item has to work its way form the rear of the queue to the front, the item at the front of the queue is always the item that has been in the queue the longest.