摘要:
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) { 阅读全文