Queues¶
Import packages
deque is a double-ended queue that allows you to efficiently add and remove elements from both ends.
Add an element to the right side - O(1)
Dequeue an element from the left side - O(1)
If simply using pop() it will act as a stack, removing the last element added (LIFO).
Peek at the leftmost element without removing it - O(1)