for(index=arr.length/2;index>0;index=index/2){
for(i=index;i<arr.length;i++){
tmp=arr[i];
for(j=i;j>0&&arr[j-index]<tmp;j=j-index){
arr[i]=arr[j-index];
}
arr[i]=tmp;
}
}
09-04
1161
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-04
675
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)