Adapt the following classes from the textbook to have private
data members and the
needed getters
and setters
where necessary:
TreeNode<T>
TreeException
BinaryTreeBasis<T>
BinaryTree<T>
TreeIterator<T>
KeyedItem<KT>
BinarySearchTree<T>
Make sure to include the following methods in the BinarySearchTree<T>
class:
height()
height(TreeNode<T> root)
isBalanced()
isBalanced(TreeNode<T> root)
balance()
balance(Object[] arr, int first, int last)
Create a MyInteger
class that extends KeyedItem<KT>
.
Your driver program should do the following things 10 times:
MyInteger
objects randomly generated.
Save all your randomly generated MyInteger
objects in a Vector<MyInteger>
.
MyInteger
entries in the BinarySearchTree<MyInteger>
.
BinarySearchTree<MyInteger>
for all the
MyInteger
entries in your Vector<MyInteger>
.
BinarySearchTree<MyInteger>
.
BinarySearchTree<MyInteger>
.
Please make sure that all your Java programs are in the default package.
Please compress the Java programs as a zip file containing:
Please submit your zip file at the
Mimir Platform Website
.