descending heap sort
- by user1
use heap sort to sort this in descending order and show the steps or explanation please
below is the tree
79
33 57
8 25 48
below is the array
79 - 33 - 57 - 8 - 25 - 48
ok ascending is easy because the largest element is at the top we can exchange the last element and the first element and then use heapify as the sample code in wikipedia describes it.