标签:style blog color ar sp div on log bs
插入排序实现:
def insert_sort(arr): i =1 while i <=len(arr)-1: key = arr[i]; j =i -1 i +=1 while j >=0 and arr[j]>key: arr[j+1] = arr[j] j -=1 arr[j+1] = key return arr a = insert_sort([1,2,4,3]) print(a)
标签:style blog color ar sp div on log bs
原文地址:http://www.cnblogs.com/dingblog/p/4040587.html