Python选择排序
def xuanze(li):
for i in range(len(li)-1):
min_loc=i
for j in range(i+1,len(li)):
if li[j]<li[min_loc]:
min_loc=j
if min_loc!=i:
li[i],li[min_loc]=li[min_loc],li[i]
li = [3,2,4,1,5,7,9,6,8,1,2,456,7879,454,12,121,21,15,454,5,545,4545,5,
原创
2020-10-27 10:58:10 ·
76 阅读 ·
0 评论