Question: | | | Part 2 : BinarySearchTree Class Interface For this project, you are also to create a wrapper BinarySearchTree Class. In reality, this class
Part : BinarySearchTree Class
Interface
For this project, you are also to create a wrapper BinarySearchTree Class. In reality, this class doesn't do that much. The
class simply starts recursion of the root itself.
Naturally, there is some logic needed to handle an null root, but that is just a few basic ifstatements.
public class BinarySearchTree
BinarySearchTree Constructor.
Node root Private
string about Returns text about you the author of this class.
string toTree Returns a string of the trees structure.
It will start recursion from the root node with indent and a label of
"Root".
String toSortedList Returns a string sorted by the key. Please see below.
It will start recursion from the root node.
void addint key, String value Adds the key to the correct position in the BST If the key already
exists, do nothing.
string findint key Finds a node with the key and returns the value. If the node is not
found, you can return an empty string.
Pseudocode
class BinarySearchTree
private Node root
All your methods go here.
end class
In java programming, please include comments and picture of the result. Thank you.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
