Assume that you have a complete tree with 200 nodes and


Assume that you have a complete tree with 200 nodes, and that you represent it in array form.

1. Node A of the tree is in position 50 of the array. What are the indices of A's left child, right child, and parent? Explain how you got your answers.

2. What is the height of the tree? Explain your answer briefly.

3. The bottom level of the tree contains some number of leaf nodes. Is the rightmost leaf node in the bottom level the left child of its parent or the right child of its parent? Explain your answer briefly.

4. In Problem 6, you will implement a method that determines if the complete tree corresponding to an array of values is a heap. What is the efficiency of determining if an array of length n represents a heap in the best case? In the worst case? Use big-O notation, and explain your answers briefly.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Assume that you have a complete tree with 200 nodes and
Reference No:- TGS02850613

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)