Khác biệt giữa bản sửa đổi của “Sắp xếp vun đống”
Nội dung được xóa Nội dung được thêm vào
Clean-up code |
|||
Dòng 53:
#include <conio.h>
const int n = 10;
typedef int keytype;
typedef float othertype;
typedef struct recordtype
};
// khai bao mang a co n phan tu
Dòng 65:
void Swap(recordtype &x, recordtype &y)
{
}
void PushDown(int first, int last)
{
if (a[first].key > a[last].key)
Swap(a[first], a[last]);
▲ if ((a[first].key > a[2*first+1].key) && (a[2*first+1].key <= a[2*first+2].key))
PushDown(2 *
} else if ((a[first].key > a[2*first+2].key) &&
}
▲ }
}
void HeapSort(void)
{
}
void readList(recordtype a[])
{
}
void printList(recordtype a[])
{
}
int main()
|