|
Data Structures and Algorithms
with Object-Oriented Design Patterns in Python |
In addition to self, the EnqueueHead method takes a single argument--the object to be added to the head of the deque. The method simply calls the LinkedList.prepend method. Since the running time for prepend is O(1), the running time of enqueueHead is also O(1).