![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 60
潇洒子弦
这个作者很懒,什么都没留下…
展开
-
python插入排序
def insert_sort(list): for i in range(len(list)): while i > 0 and list[i] < list[i-1]: temp = list[i] list[i] = list[i-1] list[i-1] = temp i = i-1原创 2014-08-12 14:38:50 · 934 阅读 · 0 评论 -
python选择排序
def select_sort(list): for i in range(len(list)): position = i for j in range(i,len(list)): if list[position] > list[j]: position = j temp = list[i] list[i] = list[position] list[pos原创 2014-08-12 14:28:52 · 909 阅读 · 1 评论 -
python冒泡排序
def bubble_sort(list): for i in range(len(list)): for j in (range(i,len(list))): if list[j] temp = list[j] list[j] = list[i]原创 2014-08-12 14:13:21 · 1107 阅读 · 0 评论