In: Computer Science
Related to HeapSort
(a) Construct a heap for the following array of numbers: 8 1 2 3 5 6 4 7 10 9
Show the array after the insertion of each element into the heap.
(b) Use your heap to sort the array. Show the resulting heap after the extraction of each maximum.
Hope this resolves your doubt.
Please give an upvote if you liked my solution. Thank you :)