1 #include2 typedef int KeyT; 3 typedef int ElemType; 4 typedef struct 5 { 6 KeyT key; 7 ElemType data; 8 }ST; 9 void Sift(ST R[],int low,int high)10 {11 int i=low,j=2*i;12 ST t=R[i];13 while(j<=high)14 {15 if(j =1;i--)33 Sift(R,i,n);34 for(i=n;i>=2;i--)35 {36 t=R[1];37 R[1]=R[i];R[i]=t;38 Sift(R,1,i-1);39 }40 }41 int main()42 {43 ST R[100];44 KeyT A[]={ 75,87,68,92,88,61,77,96,80,72};45 int i,n=10;46 for(i=0;i