Queue is also an abstract data type in which the elements are inserted from one end called REAR/BACK, and the deletion of existing elements takes place from the other end called as FRONT/HEAD. This makes queue as FIFO data structure, which means that element inserted first will also be removed first.
Adding the element into the back of the queue.
Removing the element from the front of the queue.
Following image will explain these operations better:
void enque(T elem);
void Queue<T>::enque(T elem)
Complexity: O(1) for all of the above operations.