当前位置:网站首页>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

边栏推荐
- The pressure of large institutions in the bear market has doubled. Will the giant whales such as gray scale, tether and micro strategy become 'giant thunder'?
- How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
- MySQL syntax (basic)
- Shim and Polyfill in [concept collection]
- Advanced APL (realize group chat room)
- Practice of enterprise ab/testing platform
- centos php7.3安装redis扩展
- LeetCode
- golang操作redis:写入、读取hash类型数据
- DBNet:具有可微分二值化的实时场景文本检测
猜你喜欢

深度学习参数初始化(一)Xavier初始化 含代码

Software testing learning - the next day

JMeter test result output

2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)

Software testing assignment - day 1

10000小时定律不会让你成为编程大师,但至少是个好的起点

Pytest -- write and manage test cases

MySQL installation

Jenkins

Asynchronous programming: async/await in asp Net
随机推荐
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
691. Cube IV
Book recommendation~
Arctic code vault contributor
PHP install composer
Architecture notes
深度学习参数初始化(一)Xavier初始化 含代码
Software testing learning - the next day
Basic components and intermediate components
Pytest -- write and manage test cases
My 2020 summary "don't love the past, indulge in moving forward"
Laravel frame step pit (I)
Journal quotidien des questions (11)
Application scenarios of Catalan number
保险公司怎么查高血压?
Laravel Web Framework
多个全局异常处理类,怎么规定执行顺序
These two mosquito repellent ingredients are harmful to babies. Families with babies should pay attention to choosing mosquito repellent products
Troubleshooting of high CPU load but low CPU usage
Flask Foundation
