CS 2500: Project 5 -- binary search tree

Due Monday, Dec. 12, 10:00 pm

 

For this project, you will develop a Java program that will implement a simple binary search tree. Make sure to use a class for the binary search tree, with a driver program to exercise it. You should have the operations:

Submission: Submission: Use the CS homework submission system. Submit (at least) two files. Be sure to clearly identify yourself in the comments of your program (i.e., with your real name :-).

Input data: The input to the program will come from standard input. I will test your program with various examples

Scoring: The maximum possible score for the project will be 80 points. There will be up to 40 points for correct operation of your program, and up to 40 points for style, comments, etc.

Late programs will have their maximum possible score reduced to 0.9 times previous for each calendar day late (i.e., maximum possible score = 80 * (0.9^n) for n days late . . .).


Example:

(i)nsert, (l)ocate, (p)rint, (q)uit: i
insert: m
(i, l, p, q): i
insert: f
(i, l, p, q): i
insert: t
(i, l, p, q): i
insert: c
(i, l, p, q): i
insert: b
(i, l, p, q): i
insert: h
(i, l, p, q): i
insert: g
(i, l, p, q): i
insert: r
(i, l, p, q): p
         b
      c
   f
         g
      h
m
      r
   t
(i, l, p, q): i
insert: x
(i, l, p, q): i
insert: w
(i, l, p, q): p
         b
      c
   f
         g
      h
m
      r
   t
         w
      x
(i, l, p, q): l
locate: f
'f' is in the tree
(i, l, p, q): l
locate: w
'w' is in the tree
(i, l, p, q): l
locate: e
'e' is not in the tree
(i, l, p, q): l
locate: n
'n' is not in the tree
(i, l, p, q): q