recursive algorithm

【Overview】

  1. Recursive algorithm: An algorithm that uses the relationship between adjacent data items (ie: recursive relationship) to obtain intermediate inferences until the result is obtained through known conditions.
  2. Recursion relationship: Given a sequence of numbers H0, H1,..., Hn, if there is an integer N0, so that when n>N0, you can use =/>/< to connect Hn to some of its preceding items Hi(0<i <n) to connect.
  3. Features: It avoids the trouble of finding the general term formula, and decomposes the solution of a complex problem into several consecutive simple operations.
  4. Basic idea: transform a complex and huge computational process into multiple repetitions of a simple process.
  5. Inverse and forward: When calculating, if the quantitative relationship between the front and rear processes (ie: recursion) can be found, then, pushing from the known conditions to the problem is called forward pushing, and pushing from the problem to the known conditions is called forward pushing. push back.
  6. Comparison of recursion and recursion: Compared with the recursive algorithm, the recursive algorithm avoids the process of data entering and exiting the stack, that is, it does not need the function to continuously move closer to the boundary value, but directly starts from the boundary until the function value is obtained.

[Five typical recurrence relationships]

1.

2.

3.

4.

5.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324724967&siteId=291194637