摘要: If you played with the fibonacci function from Section 6.7, you might have noticed thatthe bigger the argument you provide, the longer the function takes to run. Furthermore,the run time increases very quickly.To understand why, consider Figure 11.2, which shows the call graph for fibonacci withn=4: 阅读全文
posted @ 2013-09-28 21:27 l3sl!e 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 在中第十章的练习中,涉及到了分半查找的bisect模块。为此,在网上查阅了Python中bisect模块的相关内容。有几个链接相对权威和明白:1> http://docs.python.org/2/library/bisect.html2> http://www.cnblogs.com/skydesign/archive/2011/09/02/2163592.html这里,就我有疑问的地方做个记录:第一,bisect模块中的函数都有哪些用途。根据Python网站的参考手册,这个模块的主要用途是运用Bisection Algorithm(分半算法)在已序的列表中进行查找和插入操作。练 阅读全文
posted @ 2013-09-28 11:31 l3sl!e 阅读(675) 评论(0) 推荐(0) 编辑