sort.c
// ascending order, build a max heap
ascending order, build a max heap
ascending order build a max heap
void buildHeap(int array[], int n) {
	int i;
	for (i = n / 2 - 1; i >= 0; --i) {
		heapify(array, n, i);
	}
}
void buildHeap ( int array [ ] , int n ) { int i ; for ( i = n / 2 - 1 ; i >= 0 ; -- i ) { heapify ( array , n , i ) ; } }
ascending order, build a max heap
ascending order build a max heap
// heapify every elements from the last leaf to 0 inclusive // no need to heapify nodes with no children