""" This implementation of the Queue ADT comes from Problem Solving with Algorithms and Data Structures using Python 3rd Edition Miller, Ranum, and Yasinovskyy It is constructed utilizing the built in Python list and considering the rear to be to the "left" or "top" end of the list and the front to be to the the "right" or "bottom" end of the list. """ class Queue: """Queue implementation as a list""" def __init__(self): """Create new queue""" self._items = [] def is_empty(self): """Check if the queue is empty""" return not bool(self._items) def enqueue(self, item): """Add an item to the queue""" self._items.insert(0, item) def dequeue(self): """Remove an item from the queue""" return self._items.pop() def size(self): """Get the number of items in the queue""" return len(self._items) def peek(self): return self._items[-1]