归并排序 void Merge(RcdType SR[],RcdType TR[],int i,int m,int n) ∥将有序的SR[i.m和SR[m+1.n]归并为有序的TRi.n] for (j=m+1,k=i;i<=m &j<=n;++k){ if(SR[i].key<=SR[j].key)TR[k]SR[i++]; else TR[k]SR[++]; while (i<=m)TR[k++]=SR[i++] while (j<=n)TR[k++]SR[j++]; }∥Merge归并排序 void Merge (RcdType SR[], RcdType TR[], int i, int m, int n) { // 将有序的SR[i..m]和SR[m+1..n]归并为有序的TR[i..n] for (j=m+1, k=i; i<=m && j<=n; ++k) { if (SR[i].key<=SR[j].key) TR[k] = SR[i++]; else TR[k] = SR[j++]; } while (i<=m) TR[k++] = SR[i++]; while (j<=n) TR[k++] = SR[j++]; } // Merge