This week's assignment consists of two parts, the first of which will be reused in the next assignment. It is an exercise in developing template classes, working directly with linked lists and iterators (not the STL), and testing. Begin your work early!
For this assignment you will develop your own pared-down version of the STL list class and an iterator class to work with it. We will do some significant templated singly linked list development in class this week. Use those files (Insetlist*, Node.cpp, Set*) as a starting point for this assignment. You will need to add the backwards pointers, some general functions, and make the iterator two-way. Unlike the lecture examples, this list is not meant to be maintained in any particular order. You will then build upon this assignment in solving the next one.
Create a general-purpose doubly linked (unordered) list template class with the following functions [2 pts each]: a deep copy constructor, a destructor, addFront, addBack, deleteFront, deleteBack, display. Your class may include other functions as well, both public and/or private helpers.
Create a 2-way iterator template class for your doubly linked list. This must include next(), prev(), hasNext() and hasPrev() functions [2 pts each]. You may include other functions as well.
Remember to protect and encapsulate data as much as possible. You may only have specific "using" statements, not "using namespace std". You must use valgrind to make sure there are no memory leaks! [3 pts]
Write a driver program (p6.cpp) to thoroughly test your linked list and iterator classes on real numbers (doubles), and strings. Your program must not have any user input. Do white-box testing to ensure that every function in the list and iterator classes gets called every way possible. Make sure to include boundary cases, for example, to display an empty list. Make your test program self-documenting: this means that each time the program produces output as a result of testing some function, it also displays exactly what that output should look like. That way it is immediately obvious when running the program if it is behaving properly or not.