当前位置:网站首页>Recursion and recursion
Recursion and recursion
2022-07-03 22:37:00 【four hundred and eighty-six thousand six hundred and fifty-seven】
Recurrence : Know the initial conditions , The initial condition is pushed upward until the target solution is obtained . The starting point of recursion is generally determined by the topic or the actual situation , Not derived from recursive relations . If the starting point of recursion cannot be determined , Then recursive algorithm cannot be realized . so , Recursive starting point is an important part of recursive algorithm .
Core code :
int main(){
cin>>N;
Bigint f[5010];
f[1]=Bigirt (1);
f[2]=Bigirt (2);
for (int i3=3;i<=N;i++)
f(i)=f(i-2)+f(i-1);
f(N).print();
return 0;
}
recursive thinking : Constructors , Call yourself when the function is running .
Recursive function is to call its own function , Often used to deal with factorials 、 Yang hui triangle 、 Fibonacci sequence, etc
边栏推荐
- Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028
- Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)
- Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
- pycuda._ driver. LogicError: explicit_ context_ dependent failed: invalid device context - no currently
- Shell script three swordsman awk
- This time, thoroughly understand bidirectional data binding 01
- Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
- Buuctf, misc: sniffed traffic
- 2022 safety officer-b certificate examination summary and safety officer-b certificate simulation test questions
- Why should enterprises do more application activities?
猜你喜欢

320. Energy Necklace (ring, interval DP)
![[dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)](/img/29/543dce2f24130d22c1824385fbfa8f.jpg)
[dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)
![[actual combat record] record the whole process of the server being attacked (redis vulnerability)](/img/9c/34b916aca2f9270ec4cf4651f0de7e.jpg)
[actual combat record] record the whole process of the server being attacked (redis vulnerability)
![[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)](/img/1d/044e81258db86cf34eddd3b8f5cf90.jpg)
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)

Covariance

Summary of basic knowledge of exception handling

How to solve win10 black screen with only mouse arrow

SDMU OJ#P19. Stock trading

Pointer concept & character pointer & pointer array yyds dry inventory
Creation of the template of the password management software keepassdx
随机推荐
Flutter internationalized Intl
6.0 kernel driver character driver
Overview of Yunxi database executor
Some 5000+ likes, the development notes of a director of cosmic factory, leaked
540. Single element in ordered array
To rotate 90 degrees clockwise and modify the video format
js demo 计算本年度还剩下多少天
The overseas listing of Shangmei group received feedback, and brands such as Han Shu and Yiye have been notified for many times and received attention
Preliminary analysis of smart microwave radar module
Mongoose the table associated with the primary key, and automatically bring out the data of another table
4 environment construction -standalone ha
Data consistency between redis and database
Blue Bridge Cup -- Mason prime
The latest analysis of crane driver (limited to bridge crane) in 2022 and the test questions and analysis of crane driver (limited to bridge crane)
Teach you how to run two or more MySQL databases at the same time in one system
LeetCode 1646. Get the maximum value in the generated array
Team collaborative combat penetration tool CS artifact cobalt strike
Summary of basic knowledge of exception handling
Rest reference
Buuctf, misc: sniffed traffic