CSC
12.DivideAndConquer_outside

# 2004 goodrich tamassia divide and conquer 11 master

• Notes
• 19

This preview shows pages 11–16. Sign up to view the full content.

2004 Goodrich, Tamassia Divide-and-Conquer 11 Master Method, Example 2 The form: The Master Theorem: Example: d n n f b n aT d n c n T if ) ( ) / ( if ) ( . 1 some for ) ( ) / ( provided )), ( ( is ) ( then ), ( is ) ( if 3. ) log ( is ) ( then ), log ( is ) ( if 2. ) ( is ) ( then ), ( is ) ( if 1. log 1 log log log log n f b n af n f n T n n f n n n T n n n f n n T n O n f a k a k a a a b b b b b n n n T n T log ) 2 / ( 2 ) ( Solution: log b a=1, so case 2 says T(n) is O(n log 2 n).

This preview has intentionally blurred sections. Sign up to view the full version.

© 2004 Goodrich, Tamassia Divide-and-Conquer 12 Master Method, Example 3 The form: The Master Theorem: Example: d n n f b n aT d n c n T if ) ( ) / ( if ) ( . 1 some for ) ( ) / ( provided )), ( ( is ) ( then ), ( is ) ( if 3. ) log ( is ) ( then ), log ( is ) ( if 2. ) ( is ) ( then ), ( is ) ( if 1. log 1 log log log log n f b n af n f n T n n f n n n T n n n f n n T n O n f a k a k a a a b b b b b n n n T n T log ) 3 / ( ) ( Solution: log b a=0, so case 3 says T(n) is O(n log n).
© 2004 Goodrich, Tamassia Divide-and-Conquer 13 Master Method, Example 4 The form: The Master Theorem: Example: d n n f b n aT d n c n T if ) ( ) / ( if ) ( . 1 some for ) ( ) / ( provided )), ( ( is ) ( then ), ( is ) ( if 3. ) log ( is ) ( then ), log ( is ) ( if 2. ) ( is ) ( then ), ( is ) ( if 1. log 1 log log log log n f b n af n f n T n n f n n n T n n n f n n T n O n f a k a k a a a b b b b b 2 ) 2 / ( 8 ) ( n n T n T Solution: log b a=3, so case 1 says T(n) is O(n 3 ).

This preview has intentionally blurred sections. Sign up to view the full version.

© 2004 Goodrich, Tamassia Divide-and-Conquer 14 Master Method, Example 5 The form: The Master Theorem: Example: d n n f b n aT d n c n T if ) ( ) / ( if ) ( . 1 some for ) ( ) / ( provided )), ( ( is ) ( then ), ( is ) ( if 3. ) log ( is ) ( then ), log ( is ) ( if 2. ) ( is ) ( then ), ( is ) ( if 1. log 1 log log log log n f b n af n f n T n n f n n n T n n n f n n T n O n f a k a k a a a b b b b b 3 ) 3 / ( 9 ) ( n n T n T Solution: log b a=2, so case 3 says T(n) is O(n 3 ).
© 2004 Goodrich, Tamassia Divide-and-Conquer 15 Master Method, Example 6 The form: The Master Theorem: Example: d n n f b n aT d n c n T if ) ( ) / ( if ) ( . 1 some for ) ( ) / ( provided )), ( ( is ) ( then ), ( is ) ( if 3.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Fall '09
• Recurrence relation, Tamassia

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern