插入排序

a = [5,2,4,6,1,3]

for j in range(1,len(a)):
    key = a[j]
    i=j-1
    while i>=0 and a[i]>key:
        a[i+1] = a[i]
        a[i] = key
        i-=1
print(a)
点赞