- 5
- 0
- 约6.01千字
- 约 27页
- 2016-09-11 发布于河南
- 举报
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
- 伟明环保-市场前景及投资研究报告-境内业务稳健运行,印尼市场贡献边际增量.pdf
- 桂东县法院系统招聘考试真题2025.pdf
- 贵州省黔南布依族2026年中考三模物理试题及答案.pdf
- 贵州省黔南州2026年中考语文二模试卷附答案.pdf
- 贵州省铜仁市2026年中考语文二模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套完整答案详解.docx
- 贵州省毕节市2026年中考语文一模试卷附答案.pdf
- 贵州省贵阳市南明区2026年中考语文一模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套参考答案详解.docx
- 贵州省贵阳市白云区2026年中考二模物理试题附答案.pdf
原创力文档

文档评论(0)