Question

1. Represent the following input 12,3,51, 8, 10,55, 16 in order to get a maximum binary heap. lustrate each step of the algor

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

Solution:

Algorithm to construct maximum binary heap:

Step 1 − Create a new node at the end of heap.
Step 2 − Assign new value to the node.
Step 3 − Compare the value of this child node with its parent.
Step 4 − If value of parent is less than child, then swap them.
Step 5 − Repeat step 3 & 4 until Heap property holds.

S/ รา 2 3 SI SI 3 16

Big-O running time of the algorithm is O(n).

Please give thumbsup, if you like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
1. Represent the following input 12,3,51, 8, 10,55, 16 in order to get a maximum binary heap. lus...
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