Comments from last time
• Purpose of Master theorem?
• What does a, b, and d represent
• Finding a, b, d from pseudocode
Div-Conquer Multiplication
1234 × 5678
n: lenth of numbers,
input size: 2n
12 × 78
1×5
34 × 56 34 × 78
12 × 56
1×6 2×5 2×6
O(n) time operations
n: lenth of numbers
Shift  multiply by 10: take
array, move all elements
Addition / subtraction:
add/subtract digits, then carry
Comment cards
https://goo.gl/RKd8vq
Faster Div-Conquer Multiplication
1234 × 5678
34 × 78 (12 + 56) × (34 + 78)
12 × 56
=
68 × 112
Faster Div-Conquer Multiplication
12345678
× 87654321
5678
× 4321
(1234 + 5678)
× (8765 + 4321)
1234
× 8765
=
6912
× 13086
Recursion Tree: T(n) = 3T(n / 2) + O(n)
n: lenth of numbers,
input size: 2n
n
n/2 n/2 n/2
n/4
n/4 n/4 n/4 n/4 n/
n/4
/4 n/4
Recursion Tree: T(n) = 2T(n / 3) + O(n)
n
n/3
n/9 n/9 n/9 n/9
n/3
Recursion Tree: T(n) = 3T(n / 3) + O(n)
n/3
n/9 n/9 n/9 n/9 n/9 n/9
n/3
n
n/9 n/9 n/9
n/3

Computer Science study slides on Recursion