数据结构(python语言描述)--基础排序算法
每个python排序函数都是在整数的一个列表上进行操作的,并且都会用一个swap函数来交换列表中两项的位置。
def swap(lyst, i ,j):
temp = lyst[i]
lyst[i] = lyst[j]
lyst[j] = temp
exchange the items at the positions i and j.
选择排序
排序最简单的策略就是搜索...
原创
2018-10-26 15:14:02 ·
357 阅读 ·
0 评论