-
Notifications
You must be signed in to change notification settings - Fork 5
lists
Dynamic lists of things that grow and shrink as necessary. The fundamental base of so much in computing are lists of some sort.
In the lists library we have here we have two different types of lists. A linked list object with an associated header object to manage it. And, we have a double linked list object that can pretty much self manage. Along with these there is also are stack and queue classes made from these primary classes for you to use.
linkListObj(void);
No parameters, gives back a linkListObj with a pointer set to NULL. When in a list, this pointer contains the address of the next node in the list.
void linkAfter(linkListObj* present);
Given a pointer to a link list object, link yourself into a list after this object.
void linkToEnd(linkListObj* present);
Given any link in a list of link list objects, walk the list to the end then link yourself into the list after the last link list object of this list.
linkListObj* getNext(void);
Return the value of your link list "next" pointer.
void setNext(linkListObj* ptr);
Set the value of your link list "next" pointer.
void deleteTail(void);
Call delete on every link list object linked to you tail.
bool isGreaterThan(linkListObj* compObj);
This method is intended to be inherited and filled in by the user. It needs to be able to return if the current link list object should be considered greater than the passed in link list object.
bool isLessThan(linkListObj* compObj);
This method is intended to be inherited and filled in by the user. It needs to be able to return if the current link list object should be considered less than the passed in link list object.