堆排序 純C代碼

跟上一篇實現思路同樣,感受仍是少出現點幻數比較好,因爲heapAdjust()調用頻繁,故要儘可能提升這段代碼的效率測試 #include <stdio.h> #define N 1000 #define INF 999999999 int h[N]; //調整堆(迭代法) //n:規模 i:二叉子堆的堆頂 void heapAdjust(int n, int par) { int tmp,
相關文章
相關標籤/搜索