« previous | Wednesday, April 6, 2011 | next »
Divide and Conquer
Example
Multiplication of Integers
In binary form, two number and consist of bits. Each integer can be rewritten as a sum of two -bit integers that represent the most and least significant bits.
Let be the total number of bit operations needed to multiply two -bit integers. In this case, .
Bitwise Shift Operator
a >> n shifts the binary digits of places to the right (essentially multiplying by ).
Master Theorem
Let be an increasing function satisfying a recurrence relation:
Whenever
- for some ,
- is an integer > 1
- and are real numbers ≥ 0
Then
Proof
Proposition. If and is a power of , then a function satisfying the recurrence relation is of the form
Proof. Let . Then