A Working Binary Tree Class
If your BinaryTree class from Project 1 isn't up to being extended for
Project 2, BinaryTree.class contains
one you can use. It has the following interface:
//Instance variables
protected BTNode root;
//Constructors
public BinaryTree()
public BinaryTree(Object item)
public BinaryTree(Object item, BinaryTree left, BinaryTree right)
//Instance methods
public Iterator iterator()
public Iterator inorderIterator()
public Iterator preorderIterator()
public Iterator postorderOterator()
//Inner classes
protected BTNode
//BTNode instance variables
public Object value;
public BTNode left;
public BTNode right;
//BTNode constructors
public BTNode()
public BTNode(Object item)
public BTNode(Object item, BTNode left, BTNode right)