#include "stdio.h"
#include "malloc.h"
#include "conio.h"
#define maxsize 5
typedef strUCt{
int key;
}redtype;
typedef struct{
redtype *r;
int length;
}sqlist;
;
;
;
void shellsort(sqlist l,int d)
{
int i,j;
d=l.length/2;
while(d0)
{
for(i=d+1;i=l.length;++i)
if(l.r[i].keyl.r[i-d].key)
{
l.r[0]=l.r[i];
for(j=i-d;j0&&l.r[0].keyl.r[j].key;j-=d)
l.r[j+d]=l.r[j];
l.r[j+d]=l.r[0];}
d=d/2;}
}
;
;<...[ 查看全文 ]