Complete the following heapsort function template void HeapSort (ItemType values , int
numValues) { int index; 1/ Convert the array of values into a heap. for (index = numValues /21;
index >=0; index--) ReheapDown (values, index, numValues-1); II Sort the array. for (1. { Swan
(values [0], values [ index ]); ReheapDown(values, , index-1);

Complete the following heapsort function template void HeapSort (Item.pdf

  • 1.
    Complete the followingheapsort function template void HeapSort (ItemType values , int numValues) { int index; 1/ Convert the array of values into a heap. for (index = numValues /21; index >=0; index--) ReheapDown (values, index, numValues-1); II Sort the array. for (1. { Swan (values [0], values [ index ]); ReheapDown(values, , index-1);