and the following methods to the BinarySearchTree class:
Returns the number of times
valueappears in the tree.
Returns the height of the tree, i.e., the length of the longest path from the root to a leaf.
Returns the weight of the tree, i.e., the sum of all the node depths.
Be sure to test your methods thoroughly before continuing.
Returns the number of tree entries that are smaller than
Returns the number of tree entries that are bigger than
Returns the average cost of a search in the tree, i.e., weight/size.
Your program should display the average of these heights and costs over all of the constructed trees. For example,
|number of values (N)||⌈log2(N+1)⌉||average cost||average height|
|N = 1,000|
|N = 2,000|
|N = 4,000|
|N = 8,000|
|N = 16,000|