冒泡排序的python实现
def sort(arr):
count = len(arr) - 1
for i in range(count):
for j in range(count-i):
if arr[j] < arr[j+1]:
arr[j], arr[j+1] = arr[j+1], arr[j]
return arr
l = [5, 2, 7, 8, 6, 1, 4, 9, 10, 1, 2, 3, 4]
print(sort(l))
文章名称:冒泡排序的python实现
当前链接:http://scyingshan.cn/article/pssegs.html