摘要:
coding:utf 8
'''
堆排序的实现
'''
import heapq
def HeapSort(list): heapq.heapify(list) heap = [] while list: heap.append(heapq.heappop(list)) list[:] ... 阅读全文
摘要:
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 阅读全文