Recursive method of calculation

Source: Internet
Author: User

The recursive method uses the method of "step by step" and uses the existing information to deduce new things.


Shun-Push method: Refers to starting from the known conditions, gradually calculate the method to solve the problem

The inverse-push method is to deduce the starting condition of the problem from the known results, and the inverse process of the extrapolation method by means of the iterative representation.


Example 1

#include <stdio.h>

#include NUM 13

int main ()

{

int i;

Long Fib[num] = {#}

for (i=2; i<num; i++)

{

Fib[i] = fib[i-1]+fib[i-2];

}

return 0;

}


Example 2

#define FETCH 1000

#define RATE 0.0171

int main ()

{

Double corpus[49];

int i;

for (i=47; i>0; i--)

{

Corpus[i] = (corpus[i+1]+fetch)/(1+RATE/12);

}

return 0;

}

Recursive method of calculation

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.