摘要: 1 # coding:utf-8 2 3 import random 4 import time 5 6 t = time.time() 7 8 # 快速排序的分割算法, 参考自编程珠玑 9 # [l, r]为闭区间10 def partion(a, l, r):11 # tmp =... 阅读全文
posted @ 2015-08-29 23:31 bitpeng 阅读(189) 评论(0) 推荐(0) 编辑
摘要: # 堆排序的Python实现# coding:utf-8import randomimport timet = time.time()# 堆排序, 按照从小到大排序,所以建立大根堆# 列表的第一个元素没有使用def ShiftDown(a, i): if not a: retur... 阅读全文
posted @ 2015-08-29 23:27 bitpeng 阅读(291) 评论(0) 推荐(0) 编辑