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

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**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