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