Question: Assume that you have a complete tree with 200 nodes, and that you represent it in array form. Node A of the tree is in

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

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

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

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.

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!