八大排序算法python实现合辑

冒泡

Gif
https://blog.csdn.net/sgn132/article/details/47279511

# -*- coding:utf-8 -*-
def bubble_sort(list):
    length=len(list)
    for index in range(length):
        for i in range(1,length-index):
            if list[i-1]

一下为测试其正确性:

list=[10,23,1,53,654,54,16,646,65,3155,546,31]
print bubble_sort(list)

https://blog.csdn.net/sgn132/article/details/47279511

你可能感兴趣的:(八大排序算法python实现合辑)