Clarifications (Project #3)
- You may not check whether a tree is empty by using comparisons similar to the following:
- left==EmptyTree.getInstance()
- tree.size()==0
- Other comparisons similar to the above
You are expected to use polymorphism (and exception handling, where appropriate) to handle the differences between empty and nonempty trees. Failure to do so will result in a large negative adjustment to your project grade.
- You may not use Collections.sort for this project.
- You may not use instanceof.
- You may not use getClass().
- The delete method must use the approach described in the lecture slides. You may not implement delete by creating a new tree and inserting all the keys from the source tree except the one you want to delete.
- For the Subtree method you may not create an empty tree and traverse the whole tree inserting only those entries within the specified range. If a simple check will tell you that an entire subtree can be excluded, your implementation should not traverse that subtree.