Write a HeapSort PROC for sorting an array of integers. For more on how the heap sort algorithm works, see these notes.
As always, document any procedures you create well!
This assignment is Level 3.
Add (Level 2) to allow the caller to specify ascending or descending order for the data to be in.
Add (Level 1) to write an auxilliary PROC that will check if an array is in order and return T/F in a flag. Use this PROC so your HeapSort will be O(n) when the array is already sorted.