In the one and only true way. The object-oriented version of 'Spaghetti code' is, of course, 'Lasagna code'. (Too many layers). Roberto Waltman
Heap sort is a comparison-based sorting algorithm. It divides the input into a sorted and an unsorted region. It iteratively shrinks the unsorted region by extracting the largest element and moving that to the sorted region.
Write a program to implement the heapsort
Before Sorting: 45 45 9 89 34 After Sorting: 9 34 45 45 89