Nan da algorithm design and Analysis course Review notes (3) l3-recursion

Source: Internet
Author: User
First, the recursive equation

According to the idea of divide and conquer, a recursive complexity can be written as a recursive equation.

First, the solution of the recursive equation--guess and then prove

This method is also referred to as the surrogate method, the steps are as follows:

1, the form of the Guess solution

2. Mathematical inductive method proves correct

Example:

We assume that there is a recursive formula like this:

We guess that the solution is T (n) =o (NLGN), and then the recursive substitution is

Special note: The result of our replacement must be strictly in line with conjecture, the above example if the last to arrive at T (N) <=cnlgn+1, we guessed wrong, we need to choose a new guessing formula.

Second, recursive regression equation--Recursive tree solution

The trouble with this method is that it is generally done using the surrogate method and the following master theorem

Example

For recursive equations:

Its recursive tree is as follows:

Third, Master theorem

If A>=1 and b>1, assume that there is a recursive function, the recursive type is as follows:

The following 3 articles are available:

Nan da algorithm design and Analysis course Review notes (3) l3-recursion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.