冒泡排序
def Bubble(data):
for i in range(len(data) - 1, -1, -1):
for j in range(i):
if data[j] > data[j + 1]:
data[j], data[j + 1] = data[j + 1], data[j]
return data
def Bubble(data):
for i in range(len(data) - 1, -1, -1):
for j in range(i):
if data[j] > data[j + 1]:
data[j], data[j + 1] = data[j + 1], data[j]
return data
本文标题:排序
本文链接:https://www.haomeiwen.com/subject/iofthltx.html
网友评论