This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: log b a = ( n log n )/n = log n is asymptotically less than n ε for any ε >0. Master method Example 4: T(n) = 2T(n/2) + n log n a=2 b=2 f(n)=n log n This example falls in between cases 2 and 3, so the master method cannot be used FYI: The actual complexity is θ ( n log 2 n) Quiz Break Suppose we have the following lists: A = 1,2,3 B = 4 C = 5,6,7 D = A.join(B) E = A.join(C) Draw a picture that shows A, B, C, D, and E, assuming version 1, and then version 2, of join. Quiz Answer, version 1 join A 1 2 3 empty B 4 empty C 5 6 7 empty Quiz Answer, version 1 join A 1 2 3 B 4 C 5 6 7 empty D E Quiz Answer, version 2 join A 1 2 3 empty B 4 empty C 5 6 7 empty Quiz Answer, version 2 join A 1 2 3 empty B 4 empty C 5 6 7 empty 1 2 3 D 1 2 3 E...
View
Full Document
 Spring '09
 Algorithms, Data Structures, Master Theorem, Binary logarithm, master method, MacMahon Master theorem, Nlogba

Click to edit the document details