冒泡排序的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://azwzsj.com/article/pssegs.html