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

Linked-List Implementation

This section presents a linked-list implementation of sorted lists that is derived from the OrderedListAsLinkedList class given in Section gif. The SortedListAsLinkedList class is introduced in Program gif. The SortedListAsLinkedList extends the OrderedListAsLinkedList class introduced in Program gif and it also extends the abstract SortedList class defined in Program gif.

   program10222
Program: SortedListAsLinkedList class.

There are no additional instance attributes defined in the SortedListAsLinkedList class. The inherited instance attributes are sufficient to implement a sorted list. In fact, the functionality inherited from the ListAsLinkedList class is almost sufficient--the only method of which the functionality must change is the insert operation.




next up previous index

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