Summary: Recursive divide-and-conquer
· What is divide-and-conquer?
Reduce a problem to sub-problems of similar
· Special case: recursive algorithms
Sub-problems have exactly the same form as the
E.g.: quick sort, merge sort, binary search
Avoid recomputing sub-problems: dynamic
Example 1. Integer Multiplication
x = x110m + x0
y = y110m + y0
(x0 and y0 have m digits)
xy = (x110m + x0)(y110m + y0)
= (x1y1) 102m + (x1y0 + x0y1) 10m + x0y0
Note that z1 = (x1 + x0)(y1 + y0) - z2 - z0,
so we need 3 multiplications and 6 additions.