Question: Implement a generic binary search tree that extends Comparable. Use a node class for the tree nodes with attributes left. right, and value. The binary
Implement a generic binary search tree that extends Comparable. Use a node class for the tree nodes with attributes left. right, and value. The binary search tree class has an attribute for the root and for the number of nodes in the tree.
It should have a constructor that creates an empty tree.
Also the following methods:
boolean isEmpty()
int size ()
void add (T item)
void traverse()
void order () traverse in order
int height()
boolean contains (T item)
boolean remove(T item)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
