Python算法
程序员文章站
2022-03-29 18:25:46
...
''' Created on 2013-8-23 @author: codegeek ''' def bubble_sort(seq): for i in range(len(seq)): for j in range(i,len(seq)): if seq[j] seq[j]: position = j if position != i: tmp = seq[position] seq[position] = seq[i] seq[i] = tmp def insertion_sort(seq): if len(seq) > 1: for i in range(1,len(seq)): while i > 0 and seq[i]
上一篇: PHP&MYSQL服务器配置说明