In: Computer Science
Make a program to perform Heap Sort, must run in Alice programming only. Only correct answers needed should be in given language Wrong answers will be downvoted
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
Heap sort algorithm is divided into two basic parts:
Initially on receiving an unsorted list, the first step in heap sort is to create a Heap data structure(Max-Heap or Min-Heap). Once heap is built, the first element of the Heap is either largest or smallest(depending upon Max-Heap or Min-Heap), so we put the first element of the heap in our array. Then we again make heap using the remaining elements, to again pick the first element of the heap and put it into the array. We keep on doing the same repeatedly untill we have the complete sorted list in our array.
Kindly revert for any queries
Thanks.