当前位置:网站首页>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
边栏推荐
- Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)
- Why should enterprises do more application activities?
- Overview of Yunxi database executor
- Teach you how to run two or more MySQL databases at the same time in one system
- DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD
- Morning flowers and evening flowers
- 33 restrict the input of qlineedit control (verifier)
- Ten minutes will take you in-depth understanding of multithreading. Multithreading on lock optimization (I)
- Opengauss database log management guide
- Yyds dry goods inventory hands-on teach you to create a jigsaw puzzle using the canvasapi
猜你喜欢
2022 safety officer-b certificate examination summary and safety officer-b certificate simulation test questions
Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Teach you how to run two or more MySQL databases at the same time in one system
1068. Consolidation of ring stones (ring, interval DP)
How the computer flushes the local DNS cache
How to solve the problem of computer networking but showing no Internet connection
2 spark environment setup local
[actual combat record] record the whole process of the server being attacked (redis vulnerability)
随机推荐
Programming language (1)
How about agricultural futures?
Es6~es12 knowledge sorting and summary
[golang] leetcode intermediate - alphabetic combination of island number and phone number
Blue Bridge Cup -- guess age
Firefox set up proxy server
The difference between SRAM and DRAM
[actual combat record] record the whole process of the server being attacked (redis vulnerability)
WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD
Overview of Yunxi database executor
Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028
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)
Classification and extension of OC
Format cluster and start cluster
How the computer flushes the local DNS cache
[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
Codeforces Round #768 (Div. 1)(A-C)
DR-NAS26-Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-5GHz-high-power-Mini-PCIe-Wi-Fi-Module
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)