logo

CMSC 132

Sections 030X/040X/050X
Assignment:     Project #7
Due Date:     Friday 04/24, 11:00PM
Open/Closed policy:     CLOSED

Binary Search Tree Map


Overview

You will implement the methods of the EmptyTree and NonEmptyTree classes. We have provided a Tree interface and a partial implementation of the SearchTreeMap class (you must implement the keyList and subMap methods). Complete documentation for these classes can be found at javadoc documentation.


Objectives

The objective of this project is to implement a polymorphic binary search tree. This project is designed to help you develop your skills at recursion, polymorphism and testing.


Grading

Testing

As always, you are expected to develop test cases that test your code. You only get a few test cases in the class PublicTests, and the release tests all have unhelpful names such as testOne and testTwo.

In addition to the release tests, there are additional secret test cases. Don't assume that just because your implementation passes the release tests, it is correct.

The WordCountGUI is not really part of this assignment, but it has been provided for fun. This program uses a SearchTreeMap to count the number of times each word appears in the text file specified by the user. You may use the program to gauge how well your SearchTreeMap implemention works. The default file is a text file containing the complete works of Shakespeare (give it a few seconds to load after pressing the button!) Of course you may enter any file name you wish into the box. (We have also included "beatles.txt" and "lincoln.txt"


Design

The SearchTreeMap class implements some of the functionality of the Map interface (although not all). A SearchTreeMap object is just a wrapper around a Tree.

Note that the insert and delete methods on Tree objects return references to Tree objects. In many cases, these functions may return a reference to the this object. However, in some cases they can't. For example. EmptyTree.getInstance.insert("a", "1") has to return an instance of an NonEmptyTree object.


Restrictions

The above restrictions do not apply to your test cases; you may write them however you wish.


Suggestions on How to Start/Implement This Programming Assignment

Web Accessibility