Project 2

Due - Tuesday, March 3, 2005

Complete question 4.33 (Chapter 4) from the text book. You may start with the following pieces of code:
TreeNode.h
Tree.h
Tree.cpp
Test.cpp
Your main task is to write the removeLeaves(TreeNode* curnode) function in Tree.cpp. The output of the test program should be:
Data: 1
Data: 3
Data: 4
Data: 7
Data: 13
Data: 18
Data: 19
Data: 24
Data: 45
Data: 47
Data: 57
Data: 89
Data: 236
Data: 654
Data: 3
Data: 4
Data: 7
Data: 13
Data: 18
Data: 24
Data: 45
Data: 47
Data: 57
Data: 236
Press any key to continue
For this project, you must submit your completed code along with a short write-up (less than 1 page) discussing the running time of your function removeLeaves(TreeNode* curnode) and providing answers to the following questions: How did you determine this to be the running time? Could you augment your program to verify that this is the running time? Do you think it might be possible to write a more efficient function?

Reminder: No part of your code may be copied from any other source. All code submitted must be original code written by you.
Sami Rollins