Individual difference is no use trying to modify the
The present question is that the sorting can be evaded, input and output sequences identical
CodePudding user response:
void ShellSort (int a [], int n)
{
Int ik=n/2;
Int I=2;
Int j=I - ik.
For (ik=n/2; Ik & gt;=1; Ik=ik/2);
{
For (I=2; i{
A [0]=a, [I].
For (j=I - ik. J & gt; 0 & amp; & A [0] {
A + ik [j]=a, [j].
}
A + ik [j]=a, [0].
}
}
}
CodePudding user response:
The code shown aboveCodePudding user response:
Never met hill sorting, but lz code clearly notPay attention to form the code below
A [I]=[j] a
He put the row in the array behavior in that element out on an array of the j I
the position row behaviorThen stick after the original a [I]? Lost??