摘要:
装饰器前面提过了,采用python的闭包特性实现: from time import time
from time import sleep def count_time(): def tmp(func): def wrapped(*args, **kargs): begin_time = time() result... 阅读全文
摘要:
这里采用的是算法导论的划分方式: import random def partition(array, left, right): pivot = array[left] i = left #j left +1 -> right for j in range(left + 1, right + 1): if array[j] right
... 阅读全文