def insert_sort_gap(ls,gap):
for i in range(gap,len(ls)): #摸到的下标
tmp=ls[i]
j=i-gao #手里的下标
while ls[j]>tmp and j>=0:
ls[j+gap]=ls[j]
j-=gap
ls[j+gap]=tmp
def shell_sort(ls):
d=len(ls)//2
while d>=1:
insert_sort_gap(ls,d)
d//=2