CS 2500: Project 5 -- binary search tree

Due Friday, May 27, 5: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: Send me your program as an attachment to an email. Send the email to tom3@csustan.csustan.edu . Make sure the subject line consists only of "cs2500 project 5" (without the quotes . . .). Make sure your attachment(s) is a plain text file (not a word-processing file . . .). In the body of your email, be sure to clearly identify yourself (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