binary search tree 4

Write a program for the creation of a BinarySearchTree.

1. It should contain methods for creating and inserting new node, deleting a node and for

searching a value in tree.

2. Also, add the following methods to the BinarySearchTree class:

numBelow(value) Returns the number of tree entries that are smaller than value.

numAbove(value) Returns the number of tree entries that are bigger than value.

numofComp(value) Returns the number of comparisons made before a successful

or unsuccessful search of the value.

height() Returns the height of the tree, i.e., the length of the longest path

from the root to a leaf.

size() Returns the size of the tree, i.e., the count of all the node

descendants.

3. Be sure to test your methods thoroughly before continuing.

4. It has been proven that adding N random elements to a binary search tree will produce, on

average, a tree with O (log N) height. In addition, the average search cost (average # of

comparison) for an arbitrary item in such a binary search tree is O (log N) (You can

generate a random number and search it in BST arbitrarily). You are to verify these results

experimentally. Write a program that prompts the user for the number of items to be stored

(N) and the number of trees to generate (T). Then, it should repeatedly (T times) store N

random numbers in a binary search tree and compute the height and average cost of

searching that tree.

Your program should display the average of these heights and costs over all of the

constructed trees. For example,

Number of values to be stored: 1000

Number of trees to generate: 100

Generating 100 trees with 1000 random values:

average cost = 11.9146

average height = 21.76

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational