Assignment 5 Help

The Provided Files

This project involves the following files. (Get most of them here.)

BST.java [*]
This is the interface for a binary search tree. You need to write a class named BinarySearchTree.java that implements this interface.
(BinarySearchTree.java)
Not provided. This is the file you need to write that implements BST.java. You will probably need to write a few more private helper methods that are not specified in BST.java.
TreeNode.java [*]
Use this to implement your BinarySearchTree (Note that you are simply using TreeNodes. You are not implementing or extending any Node or TreeNode classes in this assigment.)
BSTException.java [?]
Thrown by BinarySearchTree.
DictionaryEntry.java [ ]
We will be using this class of objects to put into the finished BSTApplet. You need to write the compareTo and the toString methods.
TestBST.java [?]
This file will check both your DictionaryEntry methods and your BinarySeachTree.
BSTApplet.java and bst.html [?]
I will give you the applet file this time. Feel free to change it as much as you want--move buttons around, change the colors, add more functionality. But it should still do everything specified by the assignment.

[*] = Do not change this file.
[?] = You may change this file if you want to, but you don't need to.
[ ] = You need to edit this file.
(No mark.) = You need to create this file.

The a5files.zip contains all the .java files and this page, for easy downloading.
You can also check out the the documentation pages for these files.

"So what do I need to do?"

You need to write/change:

  1. DictionaryEntry.java -- write the compareTo and toString methods.
  2. BinarySearchTree.java -- write this file, which implements BST.java. You will use TreeNode.java to implement the tree, and you will throw BSTExceptions from here. The applet will use this class and DictionaryEntry.

Questions?

Is something here unclear? Email me or Blanca..

FAQs

What should I turn in?
Send me all the .java files you created or edited. If you changed bst.html, you can send me that too. Also include a link to a working version of the applet on the web.
I'm still confused about the relationships between the different classes.
Perhaps this diagram will help you conceptualize what's going on.

Diagram of A5 class relationships

  ← Back to Assignment 5