profile_min_max.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:bintrees 作者: mozman 项目源码 文件源码
def main():
    fp = open('testkeys.txt', 'w')
    fp.write(repr(keys))
    fp.close()
    print("Nodes: %d" % len(keys))

    shuffle(keys)

    t = Timer("rb_pop_min()", setup_RBTree)
    print_result(t.timeit(COUNT), 'RBTree pop_min')

    t = Timer("rb_pop_max()", setup_RBTree)
    print_result(t.timeit(COUNT), 'RBTree pop_max')

    t = Timer("crb_pop_min()", setup_FastRBTree)
    print_result(t.timeit(COUNT), 'FastRBTree pop_min')

    t = Timer("crb_pop_max()", setup_FastRBTree)
    print_result(t.timeit(COUNT), 'FastRBTree pop_max')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号