Binary Tree Lab 2

CPE 103 

Work with your assigned partner to complete the activity below.
Record in your lab notebook your plans, the steps you carried out, conclusions,
and what you learned.

Overview
The difference between a Binary Tree and a Binary Search Tree (BST) is that the elements in a BST are maintained in order so the tree can be searched efficiently.  In this lab activity you will write a method to create such an ordered tree.

Directions
1. Download the skeleton and support class needed for this lab:

BinaryTreeLabSkeleton.java
BinaryNode.java

2. Rename the skeleton to BinaryTreeLab.java.
3. Create a BlueJ project and add the two classes to the project.

4. You are to implement the insertBinaryNode() method, using recursive search.

You must use recursion (not iteration) to solve this problem.

5. When you have completed your own testing, run the instructor's client program:
  1. Download the BTdriver.class file into your BlueJ project directory.
  2. Open a terminal window and navigate to the project directory.  Execute the driver by invoking the Java VM:   java BTdriver
  3. Enter a list of words in any order, and press <Ctrl-D>.  The words should be output in alphabetical order.

6. Submit BinaryTreeLab.java to Web-CAT for automated grading.