python list列表冒泡排序

array = [1,2,3,6,5,4]
for i in range(len(array)):
    for j in range(i):
        if array[j] > array[j + 1]:
            array[j], array[j + 1] = array[j + 1], array[j]
print array
posted @ 2017-11-07 19:14  leeQQQ  阅读(3230)  评论(0编辑  收藏  举报