十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
func shellSort(unsorted []int, n int) { var i, j, gap int var temp int for gap = n/2; gap > 0; gap /= 2 { for i = gap; i < n; i++ { for j = i - gap; j>=0 && unsorted[j]>unsorted[j+gap]; j-=gap { temp = unsourted[j] unsorted[j] = unsorted[j+gap] unsorted[j+gap] = temp } } } }