This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Substitution Prove T(n) <= cn log 2 n for n >= 2 Induction: Base Case: Induction Hypothesis: A better mergesort (?) Divide into 3 subarrays and recursively sort Apply 3-way merge What is the recurrence? Unroll recurrence for T(n) = 3T(n/3) + dn T(n) = aT(n/b) + f(n) T(n) = T(n/2) + cn Where does this recurrence arise? 3 Solving the recurrence exactly T(n) = 4T(n/2) + cn T(n) = 2T(n/2) + n 2 T(n) = 2T(n/2) + n 1/2 Recurrences Three basic behaviors Dominated by initial case Dominated by base case All cases equal we care about the depth...
View Full Document