Documente Academic
Documente Profesional
Documente Cultură
RECURRENCE
There are two important ways to categorize (or major) the effectiveness and
efficiency of algorithm:
Time complexity and space complexity.
The time complexity measures the amount of time used by the algorithm.
The space complexity measures the amount of space used.
We are generally interested to find the best case, average case and worst
case complexities of a given algorithm. When a problem becomes large, we
are interested to find asymptotic complexity and O (Big-Oh) notation is used
to quantify this.
Recurrence relations often arise in calculating the time and space complexity of
algorithms. Any problem can be solved either by writing recursive algorithm or
by writing non-recursive algorithm. A recursive algorithm is one which makes a
recursive call to itself with smaller inputs. We often use a recurrence relation to
describe the running time of a recursive algorithm.
A recurrence relation is an equation or inequality that describes a function in
terms of its value on smaller inputs or as a function of preceding (or lower) terms.
Space Complexity: The Space Complexity of an algorithm is the amount of memory it needs to
run to completion.
METHODS FOR SOLVING RECURRENCE RELTIONS
We will introduce three methods of solving the recurrence equation:
1. The Substitution Method (Guess the solution & verify by Induction)
2. Iteration Method (unrolling and summing)
3. The Recursion-tree method
4. Master method
In substitution method, we guess a bound and then use mathematical induction
to prove our guess correct.
The iteration method converts the recurrence into a summation and then relies on
techniques for bounding summations to solve the recurrence and the Master
method provides bounds for the recurrence of the form.