摘要: arr = [8,2,4,7,3,6] length = len(arr) for j in range(1,length): key = arr[j] i = j-1 while i>-1 and arr[i]>key: arr[i+1] = arr[i] i = i-1 arr[i+1] = key print(arr) 阅读全文
posted @ 2019-03-06 01:46 菜の可怜 阅读(129) 评论(0) 推荐(0) 编辑