当前位置:网站首页>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
边栏推荐
- 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
- Label coco format data and format data in the upper left corner and lower right corner are mutually converted
- Rest reference
- 1 Introduction to spark Foundation
- [sg function]split game (2020 Jiangxi university student programming competition)
- The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
- Can you draw with turtle?
- Report on the current situation and development trend of ethoxylated sodium alkyl sulfate industry in the world and China Ⓞ 2022 ~ 2027
- Pat grade A - 1164 good in C (20 points)
- Shell script three swordsman awk
猜你喜欢

Unique in China! Alibaba cloud container service enters the Forrester leader quadrant

Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet

The reason why the computer runs slowly and how to solve it

Kali2021.4a build PWN environment

IPhone development swift foundation 09 assets

Pat grade A - 1164 good in C (20 points)

Unique in China! Alibaba cloud container service enters the Forrester leader quadrant

User login function: simple but difficult

Correlation

How can enterprises and developers take advantage of the explosion of cloud native landing?
随机推荐
pivot ROP Emporium
2022 free examination questions for safety management personnel of hazardous chemical business units and reexamination examination for safety management personnel of hazardous chemical business units
Some 5000+ likes, the development notes of a director of cosmic factory, leaked
Rest参考
[sg function] lightoj Partitioning Game
DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD
string
IDENTITY
WiFi 2.4g/5g/6g channel distribution
How to connect a laptop to a projector
How to switch between dual graphics cards of notebook computer
[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
Awk getting started to proficient series - awk quick start
The reason why the computer runs slowly and how to solve it
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
Pooling idea: string constant pool, thread pool, database connection pool
2022 high altitude installation, maintenance and removal of examination question bank and high altitude installation, maintenance and removal of examination papers
js demo 计算本年度还剩下多少天
China's Call Center Industry 14th five year plan direction and operation analysis report Ⓔ 2022 ~ 2028
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