- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
算法导论第二章函数增长
Ch2 Growth of Functions函数增长 Asymptotic Growth(渐进增长) Asymptotic Growth(渐进增长) Θ-notation渐进紧致界 Θ-notation Example1: n2 / 2 - 3n = Θ(n2) Example2: an3+bn2+cn+d= Θ(n3),a0 Other examples O-notation O-notation Example an3+bn2+cn+d= O(n3),a0 Proof: 前面的例子已经表明an3+bn2+cn+d= Θ(n3),又由于集合Θ(n3)是被O(n3)包含的,所以得到证明 an2+bn+d= O(n3), a0 Example O-notation Ω-notation Ω-notation Example2: an3+bn2+cn+d= Ω(n2),a0 Example: an3+bn2+d= Ω(2n2+3nlogn), a0 Example Note o-notation渐进非紧上界 Example1: 15n=o(nlogn), 2n2+d≠o(n2) ω-notation渐进非紧下界 Example: 2n2+bn+d = ω(n),而3n2 ≠ ω(n2) 渐进关系的传递性transitivity 渐进关系的自反性reflexivity 对称性和置换对称性 Asymptotic Notation in Equations方程中渐进记号 思考题 Page 50, 3.1-2, 3.1-4, 3.1-6, 3.1-7 常见函数 补充定理 模运算modular arithmetic 指数exponentials 对数 logarithms 阶乘和stirling公式 函数迭代functional iteration 对数迭代 费波那契数fibonacci numbers 费波那契数fibonacci numbers 思考题 Page57 3.2-2 3.2-3 3.2-4 3.2-5 上取整和下取整相关公式 * * In the insertion-sort example we discussed that when analyzing algorithms we are --interested in worst-case running time as function of input size n运行时间关于输入规模n的函数 --not interested in exact constants in bound不关心高次项系数 --not interested in lower order terms不关心低次项 A good reason for not caring about constants and lower order terms is that the RAM model is not completely realistic anyway (not all operations cost the same) We want to express rate of growth of standard functions:表达函数的增长率 --the leading term with respect to n(主要项) --ignoring constants in front of it(忽略主要项的系数) k1n + k2 ~ n k2nlogn ~ nlogn k1n2 + k2n + k3 ~ n2 We also want to formalize e.g. that a n log n algorithms is better than a n2 algorithm(形式化) Θ(g(n)) = {f(n): There exist positive constants c1, c2 and n0 such that 0 ≤ c1g(n) ≤f(n) ≤c2g(n) for all n≥n0} --We use Θ-notation to give a tight bound on a function(紧致界) Θ(g(n)) = f(n): 当n?∞时,f(n)和g(n)趋于无穷大的阶是相同的 f(n)和g(n)均是渐进非负的,即对足够大的,f(n)和g(n)均大于等于0 算法计算时间 数量级 The worst case running time of insertion-sort is Θ(n2) --6nlgn + √nlg2n=Θ(nlgn) We
文档评论(0)