def insert_sort(data):
'''
插入排序
:paramdata:
:return:
'''
length =len(data)
for i in range(1, length):
for j in range(i,0, -1):
if data[j] < data[j -1]:
data[j], data[j -1] = data[j -1], data[j]
return data
def insert_sort(data):
'''
插入排序
:paramdata:
:return:
'''
length =len(data)
for i in range(1, length):
for j in range(i,0, -1):
if data[j] < data[j -1]:
data[j], data[j -1] = data[j -1], data[j]
return data