当前位置:网站首页>Recursion, Fibonacci sequence
Recursion, Fibonacci sequence
2022-07-03 07:06:00 【L gold p】
recursive
1. Concept and basic use 
common problem : Failure to terminate statistics resulted in an error , Stack overflow
Examples are as follows :
Case study :1-n Cumulative home and
2. Four features of recursion
1. There must be a terminable condition , Otherwise, the program will fall into an infinite loop ;
2. The subproblem is smaller in scale than the original problem , Or closer to the termination condition ;
3. The subproblem can be solved directly by recursively calling the solution process again or meeting the termination condition 2 ;
4. The solution of the subproblem should be combined into the solution of the whole problem .
3. skill
Find the recursive part and the termination part of the recursive implementation
Fibonacci series
Fibonacci:1,1,2,3,5,8,13,21,34,55,89.......
Termination part :F1=1,F2=1;
Recursive part :F(n)=F(n-1)+F(n-2), among n>2.
Fibonacci series
边栏推荐
- Unit test notes
- 2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)
- centos php7.3安装redis扩展
- Laravel Web框架
- Interface learning
- [vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
- How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
- Specified interval inversion in the linked list
- Resttemplate configuration use
- Dbnet: real time scene text detection with differentiable binarization
猜你喜欢
Golang operation redis: write and read kV data
JMeter JSON extractor extracts two parameters at the same time
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
JUC forkjoinpool branch merge framework - work theft
Personally design a highly concurrent seckill system
2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)
Software testing learning - day one
Daily question brushing record (11)
HMS core helps baby bus show high-quality children's digital content to global developers
[vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
随机推荐
Inno setup production and installation package
php安装composer
10 000 volumes - Guide de l'investisseur en valeur [l'éducation d'un investisseur en valeur]
Software testing assignment - day 1
Pytest -- write and manage test cases
La loi des 10 000 heures ne fait pas de vous un maître de programmation, mais au moins un bon point de départ
Architecture notes
mysql误删root账户导致无法登录
"Baidu Cup" CTF game 2017 February, Web: blast-1
mongodb
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record
[set theory] partition (partition | partition example | partition and equivalence relationship)
Hands on redis master-slave replication, sentinel master-slave switching, cluster sharding
Search engine Bing Bing advanced search skills
These two mosquito repellent ingredients are harmful to babies. Families with babies should pay attention to choosing mosquito repellent products
2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution
centos php7.2.24升级到php7.3
Specified interval inversion in the linked list
Win 10 find the port and close the port