In this project you will create a binary search tree


Introduction: In this project you will create a binary search tree.

Description:

Create a class called BinSearchTree. BinSearchTree will implement a binary search tree. BinSearchTree will be a generic class storing a value of the generic type.

It should have the following methods. The methods should all operate on the object making the call (none are static). 
a) add
Adds a node to the tree containing the passed value. 
b) find
Returns true if the value passed is in the tree.
c) leafCount
Returns the count of all of the leaves in the tree.
d) height
Returns the height of the tree.
e) balance
Rebuilds the tree to minimum height.
f) isPerfect

Returns true if the tree is a perfect tree.
(A perfect tree is filled at every level).
g) numLevels
Returns the number of levels in the tree.
h) isMirror
Returns true if the left subtree structure is a mirror of the right subtree
i) PreorderPrint
Prints node values using a preorder traversal.
j) Main
Demonstrates all of the above methods. 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: In this project you will create a binary search tree
Reference No:- TGS083482

Expected delivery within 24 Hours