Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

North Carolina A & T State University Program for The Creation of BinarySearchTree

North Carolina A & T State University Program for The Creation of BinarySearchTree

Question Description

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

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Course Elite only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Course Elite are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Course Elite is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Course Elite, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.