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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!