python实现希尔排序
来源:互联网 发布:cocos2d js 教程 mac 编辑:程序博客网 时间:2024/06/07 01:36
'''Created on 2017-1-6@author: admin'''def shellSort(source): gap=len(source) while gap//2!=0: insertSort(source,gap//2) gap=gap//2def insertSort(source,gap): for i in range(gap,len(source),gap): for j in reversed(range(gap,i+gap,gap)): if source[j]<source[j-gap]: tmp=source[j-gap] source[j-gap]=source[j] source[j]=tmpif __name__ == '__main__': source=[3,1,9,10,15,6,4,8] shellSort(source) for i in range(len(source)): print(source[i],end=",")
0 0
- 希尔排序--Python实现
- python实现希尔排序
- 希尔排序 Python实现
- python实现希尔排序
- 希尔排序Python实现
- Python实现希尔排序
- python实现希尔排序
- 希尔排序的Python实现
- 希尔排序算法 Python实现
- 尝试使用python实现希尔排序算法
- 用python实现希尔排序(shell_sort)
- [排序] 希尔排序(Python)
- 排序算法—希尔排序算法分析与实现(Python)
- 八大排序算法 Java、Python、C++实现 -- 希尔排序
- 八大排序之希尔排序算法-python实现
- [Python-*-算法]希尔排序
- Python 希尔排序
- Python 希尔排序
- Kernel 中断分析六——softirq
- C# 给Excel添加边框,获取有效行数,然后添加边框
- linux c++ 高并发tcp服务器架构
- resource is out of sync with the file system .
- jar包上传maven私服出错Cannot deploy artifact from the local repository
- python实现希尔排序
- VB6.0 写的日历类模块
- 程序性能优化之编译器篇(Racoon)
- git删除文件夹/文件(不删除本地文件)
- 《首席医官》感想
- 最浓缩的基于TCP协议的网络通信详解
- servlet、报表制作及Java反射杂记
- React-native学习
- Spring学习----Bean的装配(4)