recurrences
Post on 31-Dec-2015
26 Views
Preview:
DESCRIPTION
TRANSCRIPT
3
recurrence
• A recurrence is an equation or inequality that describes a function in terms of its value on smaller inputs.
• Example:– MERGE-SORT procedure could be described by the
recurrence:
5
The substitution method
• The substitution method for solving recurrences entails two steps:– 1. Guess the form of the solution.– 2. Use mathematical induction to find the
constants and show that the solution works.• The substitution method can be used to
establish either upper or lower bounds on a recurrence.
8
The recursion-tree method
• A recursion tree is best used to generate a good guess, which is then verified by the substitution method.
• Using recursion trees to generate good guesses.
10
For example
We start by focusing on finding an upper bound for the solution.
create a recursion tree for the recurrence
we assume that n is an exact power of 4
top related