标签:ret bubble tmp 冒泡排序 数据格式 sort 返回结果 alt bsp
def
bubble_sort(data,key):
length
=
len
(data)
for
i
in
range
(
len
(data)
-
1
):
for
j
in
range
(
len
(data)
-
1
):
if
(data[j][key] < data[j
+
1
][key]):
tmp
=
data[j]
data[j]
=
data[j
+
1
]
data[j
+
1
]
=
tmp
标签:ret bubble tmp 冒泡排序 数据格式 sort 返回结果 alt bsp
原文地址:http://www.cnblogs.com/lzpblog/p/6223803.html