当前位置:网站首页>Time complexity (see which sentence is executed the most times)
Time complexity (see which sentence is executed the most times)
2022-07-06 10:14:00 【megaData】
1.T (n) = O (f (n)) among f(n) Represents the sum of execution times per line of code ; and O Represents a positive proportional relationship
- Constant order O(1)
- Logarithmic order O(logN)
- Linear order O(n)
- Linear logarithmic order O(nlogN)
- Square order O(n²)
- Cubic order O(n³)
- K Order of second order O(n^k)
- Exponential order (2^n)
- The time complexity from top to bottom is increasing , Less efficient execution .
- Input range exceeds 10 Of 5 Power , Use both scanf no need cin
{
if(T(n) Constant )
{
The time complexity is O(1);
}
else
{
The time complexity is O( Retain T(n) And remove the coefficient of the highest order );
}
} Time complexity ( How many cycles are there , The time complexity is O(n To what power ));
IF Yes x Recirculation , The time complexity is O(n Of x Power );
The time complexity changes from fast to slow :O(1),O(logn),O(n),O(nlogn),O(n^2),O(n^3),O(2^n);
No matter how many lines of code are executed , As long as there is no complex structure such as circulation , So the time complexity of this code is very high O(1)
边栏推荐
- 美疾控中心:美国李斯特菌疫情暴发与冰激凌产品有关
- South China Technology stack cnn+bilstm+attention
- MySQL实战优化高手10 生产经验:如何为数据库的监控系统部署可视化报表系统?
- CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
- Super detailed steps to implement Wechat public number H5 Message push
- Cmooc Internet + education
- Installation de la pagode et déploiement du projet flask
- The underlying logical architecture of MySQL
- MySQL实战优化高手05 生产经验:真实生产环境下的数据库机器配置如何规划?
- MySQL combat optimization expert 05 production experience: how to plan the database machine configuration in the real production environment?
猜你喜欢

The 32-year-old fitness coach turned to a programmer and got an offer of 760000 a year. The experience of this older coder caused heated discussion
![[after reading the series of must know] one of how to realize app automation without programming (preparation)](/img/eb/e789d88f10787c302f9457ca7ca2cc.jpg)
[after reading the series of must know] one of how to realize app automation without programming (preparation)

Solve the problem of remote connection to MySQL under Linux in Windows

How to build an interface automation testing framework?

If someone asks you about the consistency of database cache, send this article directly to him

Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
![17 medical registration system_ [wechat Payment]](/img/b4/f9abfa0fb0447d727078069d888b57.png)
17 medical registration system_ [wechat Payment]

C miscellaneous lecture continued

Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]

Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
随机推荐
Compress decompress
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
Configure system environment variables through bat script
如何让shell脚本变成可执行文件
What should the redis cluster solution do? What are the plans?
① BOKE
MySQL learning diary (II)
Super detailed steps for pushing wechat official account H5 messages
MySQL实战优化高手06 生产经验:互联网公司的生产环境数据库是如何进行性能测试的?
解决在window中远程连接Linux下的MySQL
The governor of New Jersey signed seven bills to improve gun safety
Some thoughts on the study of 51 single chip microcomputer
C miscellaneous dynamic linked list operation
Jar runs with error no main manifest attribute
MySQL combat optimization expert 06 production experience: how does the production environment database of Internet companies conduct performance testing?
MySQL storage engine
Upload vulnerability
Why is 51+ assembly in college SCM class? Why not come directly to STM32
竞赛vscode配置指南
Set shell script execution error to exit automatically