Question

For Problems #4 through #6, consider the following pseudocode (ref: CLRSpp. 154-160): 01 HEAP SORT (A) 02 BUILD-MAX-HEAP (A) 03 for i A. length downto 2 04 exchange A [1] and Ali 05 A heapsize A heapsize 1 06 MAX-HEAPIEY (A, 1) 07 BUILD-MAX-HEAP (A) 08 A heapsize A. length 09 for i floor (A length/2) down to 1 10 MAX-HEAPIEY (A ,i) 11 MAX-HEAPIFY (A,i) 12 L 2*i 13 R 2 *i 1 14 if L A. heapsize and ALL] Ali 15 largest L 16 else 17 largest i 18 if R A. heapsize and A. [R] A [largest] 19 largest R 20 if largest i 21 exchange Ali and Allargest 22 MAX-HEAPIFY (A, largest)

Algorithm

Please answer Number 6 right and clearly!

Thanks a lot

0 0
Add a comment Improve this question Transcribed image text
Answer #1

i 6 puen unǐhak Content 16 22 284 o28 3 2 /6 64 anderts BUILD-MAY-HCAP :- Contents Dtarnaj A just, pwr dotte execut on t Jane

Add a comment
Know the answer?
Add Answer to:
Algorithm Please answer Number 6 right and clearly! Thanks a lot For Problems #4 through #6,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT