Question: 4. Suppose there is a binary min-heap with exactly 4 nodes, containing items with priorities 3,9, 11, and 15. Show every possible binary min-heap that

 4. Suppose there is a binary min-heap with exactly 4 nodes,

4. Suppose there is a binary min-heap with exactly 4 nodes, containing items with priorities 3,9, 11, and 15. Show every possible binary min-heap that could match this description. For each, draw the appropriate tree and the array representation. (You can show just the priorities, not the corresponding items.) a) b) For one of your answers to part (a), show what happens with 4 deleteMin operations. Clearly indicate which heap you are starting with and show the heap after each deleteMin. You can just draw the tree (not the array) after each step. A three-heap with n elements can be stored in an array A, where A[0] contains the root of the tree. 5. a) Draw the three-heap that results from inserting 5, 2, 8, 3, 6,4,9,7,1 in that order into an initially empty three-heap. You do not need to show the array representation of the heap. You are only required to show the final tree, although if you draw intermediate trees b) Assuming that elements are placed in the array starting at location AI0], give expressions to calculate the left, middle, and right children of the element stored in Ali]: Left child: Middle child: Right child

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!