#include <list.h>
Inheritance diagram for SortedList::

Public Methods | |
| SortedList (int(*comp)(T x, T y)) | |
| ~SortedList () | |
| void | Insert (T item) |
| insert an item onto the list in sorted order. More... | |
| void | SanityCheck () const |
| has this list been corrupted? More... | |
| void | SelfTest (T *p, int numEntries) |
| verify module is working. More... | |
Private Methods | |
| void | Prepend (T item) |
| *pre*pending has no meaning in a sorted list. More... | |
| void | Append (T item) |
| *ap*pending has no meaning in a sorted list. More... | |
Private Attributes | |
| int (* | compare )(T x, T y) |
| function for sorting list elements. More... | |
Definition at line 90 of file list.h.
|
||||
|
|
|
||||
|
|
|
||||
|
*ap*pending has no meaning in a sorted list.
Reimplemented from List. |
|
||||
|
insert an item onto the list in sorted order. SortedList::Insert Insert an "item" into a list, so that the list elements are sorted in increasing order. Allocate a ListElement to keep track of the item. If the list is empty, then this will be the only element. Otherwise, walk through the list, one element at a time, to find where the new item should be placed. "item" is the thing to put on the list. Definition at line 232 of file list.cc. Referenced by Append(), Prepend(), and SelfTest().
|
|
||||
|
*pre*pending has no meaning in a sorted list.
Reimplemented from List. |
|
||||
|
has this list been corrupted? SortedList::SanityCheck Test whether this is still a legal sorted list. Test: is the list sorted? Reimplemented from List. Definition at line 334 of file list.cc. Referenced by SelfTest().
|
|
||||||
|
verify module is working. SortedList::SelfTest Test whether this module is working. Reimplemented from List. Definition at line 354 of file list.cc. Referenced by LibSelfTest().
|
|
|||
|
function for sorting list elements.
Referenced by Insert(), SanityCheck(), and SelfTest().
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001