Homework 7 - creating a template container with iterators

Reading: Budd, Chapter 9.

Due Tuesday February 26th, at 10pm.

Program Description - Create a tree template class.

For this assignment you are to create a template version of the tnode class created for assignment three. Specifically you must create a template class that can be used with the test program tnodeTemplate.cpp. An examination of the tnodeTemplate.cpp should reveal that your template class must support the following: Both types of iterators must support: The == operator is not tested in tnodeTemplate.cpp.

Sample Execution

os-prompt% tnodeTest
one:1
two:2
now the whole tree
root:0
one:1
a:11
b:22
two:2
child1:value1
child2:value2
now the whole string tree
sroot:root value
child1:value1
child1-1:value1-1
child2:value2
child2-1:value2-1
child1 subtree should be gone
sroot:root value
child2:value2
child2-1:value2-1

Design/Correctness Points


10 points - with the exception of one line methods, all methods are defined after the class declaration.
10 points - full tree iterator works properly
10 points - child iterator works properly
10 points - basic class template ok
10 points - operator<< properly overloaded
10 points - addChild adds nodes so that the child iterator returns them in the order they were added
15 points - miscellaneous, including correct operation of getChild(), remove(), etc.