def bubble_sort(lists): # 冒泡排序 count = len(lists) for i in range(0, count): for j in range(i + 1, count): if lists[i] > lists[j]: lists[i], lists[j] = lists[j], lists[i] return lists L = [1,22,5,7,19,3,78,4,11,45,23] print(bubble_sort(L))
pythn 冒泡排序
最新推荐文章于 2020-09-04 22:08:35 发布