后台小程序开发的全方位指南
552
2022-10-26
python实现希尔排序
'''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]
发表评论
暂时没有评论,来抢沙发吧~