{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 310 Unit 2a Master Method Recurrences

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

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

View Full Document Right Arrow Icon
CS 310 Unit 2a Master Method Recurrences Furman Haddix Ph.D. Assistant Professor Minnesota State University, Mankato
Background image of page 1

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

View Full Document Right Arrow Icon
CS 310 Unit 2a Master Method Recurrences Objectives Master Method Master Method Examples Text, Chapter 4
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
Background image of page 4
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 ]}