Data Structures and Algorithms with Object-Oriented Design Patterns in Python
next up previous index

enqueueHead Method

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).


next up previous index

Bruno Copyright © 2003, 2004 by Bruno R. Preiss, P.Eng. All rights reserved.