8 # define n
Typedef int datatype.
Void ShellInsert (datatype R [], int dk)
{int I, j;
Dk for (I=+ 1; i<=n; I++)
If (R [I]
For (j=I - dk; (j> 0) & amp; & R [0]
}
R=R + dk [j] [0]. }
Void ShellSort (datatype R [], int t)
{int d [10].
For (int k=0; k
For (k=0; k
Void main (datatype R [])
{int I, j;
int k;
Printf (" integer before ordering: ");
for(j=1; j<=n; J++)
The scanf (" % d ", & amp; R [j]);
printf("\n");
ShellSort (R, 3);
Printf (" sorted integers: ");
for(k=1; k<=n; K++)
Printf (" % d ", R [k]);
printf("\n");
}
CodePudding user response:
Various sorting algorithm demo http://www.webhek.com/misc/comparison-sort/