def shell_sort(data):
'''
希尔排序
:param data:
:return:
'''
length = len(data)
h = 1
while h < length / 3:
h = 3 * h + 1
while h >= 1:
for i in range(h,length):
j=i
while j >= h and data[j] < data[j-h]:
data[j], data[j-h] = data[j-h], data[j]
j -= h
h = h//3
return data