{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 310 Unit 2a Master Method Recurrences

CS 310 Unit 2a Master Method Recurrences - ε>0 and if a...

This preview shows pages 1–4. Sign up to view the full content.

CS 310 Unit 2a Master Method Recurrences Furman Haddix Ph.D. Assistant Professor Minnesota State University, Mankato

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

View Full Document
CS 310 Unit 2a Master Method Recurrences Objectives Master Method Master Method Examples Text, Chapter 4
Master Method – Another Recurrence Tool Works for recurrences of the form: T(n) = a T(n/b) + f(n), where a 1, b > 1, and f(n) is asymptotically positive positive for n n 0 Master Method: 1. If f(n) = O(n log b a- ε ) for some constant ε >0, then T(n) = Θ (n log b a ) 2. If f(n) = Θ (n log b a ), then T(n) = Θ (n log b a lg n) 3. If f(n) = (n log b a+ ε ) for some constant ε >0, and if a f(n/b) cf(n) for some constant c > 1

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ε >0, and if a f(n/b) ≤ cf(n) for some constant c > 1 Master Method Examples 1. T(n) = 9T(n/3) + n a = 9, b = 3, f(n) = n n log b a = n log 3 9 = n 2 Let ε = 1 f(n) = O(n log b a-ε ) = O(n log 3 9-1 ) = n T(n) = O(n 2 ) 2. T(n) = T(2n/3) + 1 a = 1, b = 3/2, f(n) = 1 n log b a = n log 3/2 1 = 1 = f(n) T(n) = Θ (n log b a lg n) = Θ (lg n) 1. T(n) = 3T(n/4) + n lg n a = 3, b = 4, f(n) = n lg n n log b a = n log 4 3 2245 Ω (n 0.8 ) Let ε = 0.2 Ω (n log b a+ ε ) = Ω (n log 3 .8 + .2 ) = n ≤ n lg n = f(n)...
View Full Document

{[ snackBarMessage ]}