def Insert_Sort(row):
for i in range(len(row)):
current_index = i
while row[current_index] < row[current_index - 1] and current_index - 1 >= 0:
row[current_index], row[current_index - 1] = row[current_index - 1], row[current_index]
current_index -= 1
return row
row = [1, 2, 0, -5, 9, 2, 44, 99, 7]
插入排序 python
最新推荐文章于 2024-08-23 16:53:34 发布