Question: Given an array A [ 1 . . 7 ] = ( : 1 2 , 1 5 , 8 , 1 9 , 1

Given an array A[1..7]=(:12,15,8,19,16,11,7:), run Build-Max-Heap (A,7).
What will be the resulting array A?
19,16,15,12,11,8,7>
19,12,11,15,16,8,7>
19,16,11,15,12,8,7>
19,16,11,12,15,8,7>
Continue
Consider calling Build-Max-Heap (A,7) on array A[1..7]=
(:12,15,8,19,16,11,7:).
(1) How many key comparisons were made by Build-Max-Heap (A,7) in total?
Your answer should be a single number.
A
(2) How many swaps were made by Build-Max-Heap (A,7) in total? Your answer
should be a single number.
 Given an array A[1..7]=(:12,15,8,19,16,11,7:), run Build-Max-Heap (A,7). What will be the

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!