0001 template <typename T> void heapify ( T* A, Rank n ) { //Floyd建堆算法,O(n)时间 0002 for ( int i = LastInternal ( n ); InHeap ( n, i ); i-- ) //自底而上,依次 0003 percolateDown ( A, n, i ); //下滤各内部节点 0004 }