Master Method
Back to cs141 |
Compared with the iteration method, the master method is much easier to use once you understand how to use it. The hardest part about the master method is understanding the language of the master theorem.
Let and be constants, let be a function, and let be defined on the nonnegative integers by the recurrence:
where we interpret
to mean either
or
. Then
can be bounded asymptotically as follows:
1. If
for some constant
, then
.
2. If
, then
.
3. If
for some constant
, and if
for some constant
and all sufficiently large
, then
.
Basically all you have to do to solve a recurrence relation is figure out which of the three cases your recurrence falls into and apply the given formula to get the answer!
Practice Problems |