Troubleshoot my heap sort java code
Deliver error-free code
Comment the code to show where you have made the fix
Instructions will include:
Adding an element to end of heap.
While element is not at top of heap and element’s parent > element:
Swap element with parent
Complete the given smallestChild method, which will be needed by the remove method
Removing the smallest element
Traverse the array and add all the numbers to a heap.
Remove all the numbers from the heap and put them back into the array.