Question: Need help with C++ question please Question 1 : 7 points A heap is a special kind of tree. The minimum value is always stored

Need help with C++ question please

Need help with C++ question please Question 1 : 7 points A

Question 1 : 7 points A heap is a special kind of tree. The minimum value is always stored at the root of the tree. This tree is specifically designed to make finding the minimum as fast as possible. A heap is normally stored in an array. The array has the following properties. The Root is at index 0 The Parent of the node at index n is at index floor ((n - 1)/2) The Left Child of the node at index n is at (n+1)* 2 - 1 The Right Child of the node at index n is at index (n +1)* 2 (a) (1 point) What index is the parent of the value at index 7? (b) (1 point) What index is the parent of the value at index 8? (c) (1 point) What index is the left child of the value at index 4? (d) (1 point) What index is the right child of the value at index 4? (e) (3 points) Draw the tree representation of the below array. Index 0 1 2 3 4 5 6 Value 495 12 10 6 8

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!