摘要: coding:utf 8 ''' 堆排序的实现 ''' import heapq def HeapSort(list): heapq.heapify(list) heap = [] while list: heap.append(heapq.heappop(list)) list[:] ... 阅读全文
posted @ 2016-01-12 10:20 gopher-lin 阅读(124) 评论(0) 推荐(0) 编辑
摘要: def ChooseSort(R): for i in range(0,len(R),1): 控制循环的次数 k=i for j in range(i+1,len(R),1): if R[j]<R[k]: k=j if k!=!: R[k],R[i]= R[i],R[k] print R 阅读全文
posted @ 2016-01-12 10:15 gopher-lin 阅读(183) 评论(0) 推荐(0) 编辑