Question

It's C++ language questions, but answer in drawing circle. Please draw in paint: Given an array int alt = {100, 50, 10, 7, 6, 4, 1} -Construct Max Heap -Remove all nodes and after each removal sor...

It's C++ language questions, but answer in drawing circle.
Please draw in paint:

Given an array
int alt = {100, 50, 10, 7, 6, 4, 1}
-Construct Max Heap
-Remove all nodes and after each removal sort heap back to max heap

Thanks

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

heap deletion happens from the root and it is replaced with the last element of the heap. then do heapify and swap depending on whether the value at the root is bigger or not

50 Le 7) (6 -to with laat elument | S6 to Ne. Remove next- geBot node , swap nith lp、 3) Remove lo ick max Ramove 6

) Remove 6,repplacs uitt No need of hdap

Add a comment
Know the answer?
Add Answer to:
It's C++ language questions, but answer in drawing circle. Please draw in paint: Given an array int alt = {100, 50, 10, 7, 6, 4, 1} -Construct Max Heap -Remove all nodes and after each removal sor...
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