←
Top
/
Answer-44B-2
Answer to Question 44B-2
Notice that the first value by itself is automatically a heap, so we start with k = 1.
void
buildHeap(
int
A[],
const int
n) { for(
int
k = 1; k < n; k++) { reheapUpMax(k, A); } }