CS19 Fall 2007
Assignment 7 (Wumpus Maximus)
Directory Name
19-7
Resulting Executable
p7
Note: consider reusing your code from the previous assignment where appropriate. Consult the templatized linked list example as shown in class.
Description of the program
Define a class called DList that implements a doubly linked list using templates. You may assume that "T" will meet the general generic-class guidelines. (for example, it will be DefaultConstructible and LessThanComparable)
The DList class must support at a minimum, the following functions:
- A constructor that initializes the list to empty
- A destructor that correctly deallocates all the objects in the list. Implement the following six functions to allow nodes to be added or removed from the list. Don't forget that there are several pointers that may need to be adjusted to keep your list intact when adding or removing a node!
- void insertFront(T *)
- void insertBack(T *)
- void insertOrdered(T *)
- T *removeFront()
- T *removeBack()
- void findDelete(T *)
- void printList() sends each data node to cout, one per line.
Include a main() function that thouroughly tests your data structure. I will possible replace your main() function with my own when I test your program.