实现希尔和快速排序
typedef int KeyType;
typedef char InfoType[10];
typedef struct
{
KeyType key; InfoType data;
}RecType;
void InsertSort(RecType R[],int n)
{
}
{
int i,j,d,k; RecType temp; d=n/2; while(d>0) { { j=i-d; while(j>=0&&R[j].key>R[j+d].key) for(i=d;i<n;i++) void ShellSort(RecType R[],int n) } R[j+1]=temp; printf(" i=%d: ",i); for(k=0;k<n;k++) printf("%3d",R[k].key); printf("\n"); j=i-1; while(j>=0&&R[j].key>temp.key) { } R[j+1]=temp; j--; { temp=R[i]; for(i=1;i<n;i++) int i,j,k; RecType temp;