Data Structures and Algorithms with Object-Oriented Design Patterns in C#
next up previous contents 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 implements the SortedList interface defined in Program gif.

   program10221
Program: SortedListAsLinkedList class.

There are no additional fields defined in the SortedListAsLinkedList class. The inherited fields 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 contents index

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