There is an array given containing integers. By implementing heap sort, sort the array elements.
Write a function
solve that have the following parameter(s):
1.) arr = array of integers
There is an array of integers given:
arr = [4,5,9,7,8]
The function will return,
[4, 5, 7, 8, 9]
After sorting elements using heap sort, elements will be in order as 4,5,7,8,9.
• Number of elements in the array will be greater than or equal to 1 and less than or equal to 600.
• Each element of the array will be greater than or equal to 1 and less than or equal to 10000.