采用堆排序堆序对序列R={8,9,2,4,12,52,3}进行排序,并输出排序后的结果
#include <stdio.h>
#include<stdlib.h>
#define MAXSIZE 50
typedef int KeyType;
typedef struct {
KeyType key;
}DataType;
typedef struct {
DataType data[MAXSIZE];
int length;
}SqList;
void AdjustHeapss(SqList* H, int s, int m) {
DataType t;
int j;
t = (*H).data[s];
for (j = 2 * s; j <= m; j *= 2) {
if (j < m && (*H).data[j].key < (*H).data[j + 1].key)
j++;
if (