CS 112
Homework 10


This is part 1 of your final project. Part 2 will be handed in next week. This "homework" will not be graded as a separate homework, but rather as part of your final project (worth 20% of your final grade).

You should strive to finish it, as usually, by the Wednesday night deadline. Submit whatever you have done by the deadline in the directory Hw10. I accept, without penalty, programs with a fundamentally correct design but which perhaps are not fully debugged. However, if you have not started working on this assignement, have not submitted anything or have submitted a file that has nothing to do with the assignment, your final grade on the project will be affected.

Trees

Design, implement and test a class called BinaryTree which implements an abstract data type for a binary tree, as started in class on Thursday.
Then we will extend it to one called BinSearchTree for binary search trees.

The data structure should be implemented as described in class on Thursday. The struct definition is:

struct BTNode{
int data;
BTNode * left;
BTNode * right;
}

The class variables (private) are:
The class should contain the following functions:


Extensions (to be done next week, starting in class on Tuesday)
The Binary Search Tree class should also contain a function to create a binary search tree starting from an array, to search for a value in the tree and to sort.

You should come up with the best solution you can for this implementation. Then you should discuss your solution with me in next Tuesday's lab to check that it is sound, before embarking (next week) on the implementation of the final step of the project (which will be handed in on Thursday).




The second part of the project will be described in more detail next week. The final program should be self contained, with a menu-driven test driver which asks the user for options and a typescript with a comprehensive set of test cases.

There will be several levels of complexity for the final project, ranging from a minimum version (needed to get a passing grade on the project) to more elaborate versions, culminating to the "exceptional" version, for those aiming at the top grade. To give you a sense of the direction, the highest version will imply working with templates for defining a general Tree class template.

I will NOT give detailed instructions for you on what to implement, what files to submit, or how to test the final project. Rather, I assume that now, at the end of the semester, you know all the software engineering principles I have taught you throughout the semester, and that you will apply them. The final project will be graded accordingly.
Ileana Streinu