CIS 22 Spring 2005 - Assignment #4
CIS 22 - Data Structures
Spring 2005
Assignment #4
A List Structure with Header Nodes
Due: April 18, 2005
Overview
This assignment will give you practice with nodes and lists.
For this assignment you will re-implement the List class using a linear
list with a header node.
After you write the new implementation of the List class, you will use this
List class
to re-implement the Stack class.
Implementation Details
-
You need to write the full list class.
-
You may choose to implement the list as a template class, but you
do not have to.
(Remember that if you use templates,
the Node class must be a template class as well.)
- Write a simple test driver to test your list class.
-
Write the code for the Stack class implemented using
composition from this list class.
-
Test your classes by re-running the program you wrote for
assignment #2. (The N-queens program)
If you haven't completed Assignment #2, write some simple stack-based test
program to test this on.
What to hand in - lots of files!
- the files for the list w/header node class.
- the test driver for the list w/header node class.
- output of the test driver.
- the files for the Stack class implemented with this list.
- assignment #2 redone to use this Stack class.
- output of the N-queens program re-run with this Stack class.
Extra Credit
Implement a ListIterator for the list w/header node class and test it.