![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法分析
sunsides
这个作者很懒,什么都没留下…
展开
-
学算法与Python之不求甚解——Shell排序
# -*- coding:gb2312 -*-'''Created on 2010-7-29@author: http://g-content.appspot.com'''#希尔排序#定义一个数组#lst = [81, 94, 11, 96, 12, 24, 17, 95, 28, 58, 41, 75, 15]lst = [81, 94, 11, 96,...原创 2010-07-29 11:11:00 · 74 阅读 · 0 评论 -
用Python写插入排序
#插入排序#定义一个数组a = [34, 8, 64, 51, 32, 21]#插入排序算法实现for i in range(1, len(a)): print a print 'i is ', i tmp = a[i] print 'tmp is ', tmp b = range(1, i + 1) b.reverse() for c in...原创 2010-06-23 16:54:20 · 72 阅读 · 0 评论