- 1、本文档共27页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Let4-Recurrences
Simple Review Merge Sort MERGE(A,p,q,r) Analysis of Merge Sort-Θ(nlgn), by Picture of Recursion Tree Telescoping Mathematical Induction Asymptotic Growth O-notation Ω-notation Θ-notation Simple Review Merge Sort MERGE(A,p,q,r) Analysis of Merge Sort-Θ(nlgn), by Picture of Recursion Tree Telescoping Mathematical Induction Asymptotic Growth O-notation Ω-notation Θ-notation Design and Analysis of Algorithms Recurrences(Ch4) Three common cases Compare f(n) with nlogba : 1. f(n) = O(nlogba -ε) for some constantε 0 f(n) grows polynomially slower than nlogba (by an nε factor), Solution: T(n) = Θ(nlogba) 2. f(n) = Θ(nlogbalgkn) for some constant k≥ 0 f(n) and nlogba grow at similar rates, Solution: T(n) = Θ(nlogbalgk+1n) 3. f(n) = Ω((nlogba+ε) for some constantε 0 f(n) grows polynomially faster than nlogba (by an nε factor), and f(n) satisfies the regularity condition that af(n/b) ≤cf(n) for some constant c 1 Solution: T(n) = Θ(f(n)) Master theorem - examples T(n)=9T(n/3)+n a=9, b=3, f(n) = n logba = 2, f(n) = O(nlogba –ε) where ε=1, case 1 T(n) = Θ(nlogba) =Θ(n2) T(n)=T(2n/3)+1 a=1, b=3/2, f(n) = 1 logba = 0, f(n) = Θ(nlogbalgkn) where k = 0, case 2 T(n) = Θ(nlogbalgk+1n) =Θ(lgn) T(n)=3T(n/4)+nlgn a=3, b=4, f(n) = nlgn logba = log43≈0.793, f(n) = Ω(nlogba –ε) where ε≈ 0.2 af(n/b) = 3f(n/4) = 3(n/4)lg(n/4)≤(3/4)nlgn = cf(n) where c = 3/4, case 3 T(n) = Θ(f(n)) =Θ(nlgn) Homework 4.1-1,4.1-6,4.2-1,4.3-2,4.3-3 *Software School of XiDian University *Software School of XiDian University Θ-notation Note: --Similarly, f(n) = Θ(g(n)) corresponds to f(n) = g(n) --We often think of f(n) = O(g(n)) as corresponding to f(n)≤g(n). --Similarly, f(n) = Ω(g(n)) corresponds to f(n) ≥ g(n) Asymptotic Notation in Equations For example, 4n3 + 3n2 + 2n + 1 = 4n3 + 3n2 + Θ(n) = 4n3 + Θ(n2) = Θ(n3) Used to replace functions of lower-order terms to simplify equations/expressions. Or we can do the following: 4n3 + 3n2 + 2n + 1 = 4n3 + f(n2) Wher
您可能关注的文档
- HTC Legend (G6)拆机图.doc
- Hyper-v共享文件设置.doc
- H—电学.doc
- H型钢特性标准.doc
- Hut T.ppt
- H型刻字机说明书.doc
- hyper-v使用操作.docx
- I have goals for my life.doc
- I like singing.doc
- i9000刷机(图文介绍)完整版.docx
- 云南省红河哈尼族彝族自治州(新版)2024小学语文人教版小升初摸底(提分卷)完整试卷(含答案).docx
- 浙江省杭州市(新版)2024小学语文部编版小升初核心能力评测(培优卷)完整试卷(含答案).docx
- 黑龙江绥化市(新版)2024小学语文部编版小升初摸底(备考卷)完整试卷(含答案).docx
- 江西省鹰潭市(新版)2024小学语文统编版(五四制)小升初质量检测(提分卷)完整试卷(含答案).docx
- 广东省韶关市(新版)2024小学语文统编版小升初摸底(综合卷)完整试卷(含答案).docx
- 四川省内江市(新版)2024小学语文部编版小升初质量检测(评估卷)完整试卷(含答案).docx
- 浙江省嘉兴市(新版)2024小学语文统编版小升初核心能力评测(冲刺卷)完整试卷(含答案).docx
- 河南省濮阳市(新版)2024小学语文统编版小升初核心能力评测(评估卷)完整试卷(含答案).docx
- 上海市市辖区(新版)2024小学语文统编版(五四制)小升初考试(自测卷)完整试卷(含答案).docx
- 河南省商丘市(新版)2024小学语文统编版小升初考试(强化卷)完整试卷(含答案).docx
文档评论(0)