Question: CLAFUIN UNIVERSITY CSCI 237 DATA STRUCTURES AND ALGORITHMS TEST 3-FALL 2017 (01, 02,03.04 each 25 points) Construct a max-heap from array A You must show

 CLAFUIN UNIVERSITY CSCI 237 DATA STRUCTURES AND ALGORITHMS TEST 3-FALL 2017

CLAFUIN UNIVERSITY CSCI 237 DATA STRUCTURES AND ALGORITHMS TEST 3-FALL 2017 (01, 02,03.04 each 25 points) Construct a max-heap from array A You must show steps of the max-heap process, in array form in the table provided, to receive credit. Method: Step O: Initialize the structure with keys in the order given 2. (a) (2, 5, 7,6, 9,8,15, 11,7, 10, 12,13). (cos) Step 1: Starting with the last (rightmost) parental node, fix the heap rooted at it, if it doesn't satisfy the max-heap condition; keep exchanging it with its largest child until the heap condition holds Step 2: Repeat Step 1 for the preceding parental node 1 2 3 5 789 10 11 12 1-initial | 2 5 7 | 6 | 9 | 8 15 | 11 7 10 12 13 2 5 6 7 8 9 10 12 (b) Analyze the consequence if priority value 13 is now revised to 18, after array A is heapified. 1 2 3 4 5 7 8 9 10 11 12 1-initial 2

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!