摘要: void Swap(int *i, int *j){ int temp = *i; *i = *j; *j = temp;}void MinHeapFixup(int a[], int i) { for (int j = (i - 1) / 2; (j >= 0 && i != 0)&& a[i] > a[j]; i = j, j = (i - 1) / 2) Swap(&a[i], &a[j]); }//在最小堆中加入新的数据nNum void MinHeapAddNumber(int a[], int n, int nNum) { 阅读全文
posted @ 2012-10-09 17:51 Kalou 阅读(233) 评论(0) 推荐(0) 编辑