Question: Heaps are essentially tree structures, but can be stored as compact arrays in an elegant way. In addition, heaps need to fulfil the property that

 Heaps are essentially tree structures, but can be stored as compact

Heaps are essentially tree structures, but can be stored as compact arrays in an elegant way. In addition, heaps need to fulfil the property that the value of the top node of the heap is always larger than or equal to the values of all nodes in the tree below it, and that their data completely cover an array stretch, without gaps. Which of the following is a correct array form of a heap as per description in the lecture (complete, including arrows)? Reminder: The root of the heap is the leftmost cell of the array, the numbers in the cells are the values of the nodes. The numbers atop the array are the indices. Arrows above the array indicate a heap branch to the left, arrows below the array a heap branch to the right. 1 2 3 4 6 7 8 9 26 20 23 8 16 19 14 6 4 1 2 3 4 5 6 7 8 9 26 20 23 8 16 19 14 6 64. None of the other options

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!