void Shell_Sort(int a[], int n)
{
int h,i,j,temp;
for (h=n/2; h>0; h=h/2)
{
for (i=h; i<n; i++)
{
temp = a[i];
for (j=i-h; j>=0 && temp < a[j]; j-=h)
{
a[j+h] = a[j];
}
a[j+h] = temp;
}
}
}
希尔排序
最新推荐文章于 2023-11-28 16:53:17 发布