










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of divide and conquer algorithms, focusing on the differences between iteration and recursion. It includes examples of the towers of hanoi problem and solving recurrence equations using methods such as iteration, recurrence trees, and the master theorem. Additionally, it covers the concept of the greatest common divisor and its relationship to linear combinations and diophantine equations.
Typology: Slides
1 / 18
This page cannot be seen from the preview
Don't miss anything!











m^ is divided by^ n = m^ -^ ⎣ m / n ⎦ n • Examples: – 8 mod 3^ = 2 – 42 mod 6^ = 0 – 5 mod 7^ = 5
and^38 –Find GCD (38,10)^ –Express the GCD as a linear combination of
38 and^10 –Multiply that expression by (6/GCD) 6 = 3 (4*10 – 1 *38 )^ = 12 * 10 – 3 *^38
2 , for large n: 1. n^ has the largest value 2. n log n^ has the largest value^2 3. n has the largest value^2 4. n(log n) has the largest value
2
-^ ( n log n )/ n^ = log
n^ Æ^ ∞ n is more efficient than log n (^2) • n (log n )/^ n log n = log^ n^ Æ^ ∞ n log n is more efficient than^ n (log n
(^2 2) • n (log n )/^ n = (log (^2) n )/^ n^ Æ^0 (^2) n (log n )is more efficient than n
2
-^ Order of efficiency is^ n, n log n, n
(^2 2) (log n ) , n
lg nlg n (1/ 2)) < cn ( 1 + 3/2 + (3/2)
2 lg n^ + ... + (3/2)). (lg n + 1)^ < cn ( (3/2) –
k+1^ – 1) / (a-1) Logarithmic Behaviorlg b^ lg a a^ = b^