当前位置:网站首页>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)
边栏推荐
- Inject common SQL statement collation
- MySQL combat optimization expert 05 production experience: how to plan the database machine configuration in the real production environment?
- Configure system environment variables through bat script
- Good blog good material record link
- Hugo blog graphical writing tool -- QT practice
- MySQL combat optimization expert 09 production experience: how to deploy a monitoring system for a database in a production environment?
- flask运维脚本(长时间运行)
- Installation of pagoda and deployment of flask project
- 13 medical registration system_ [wechat login]
- A necessary soft skill for Software Test Engineers: structured thinking
猜你喜欢
South China Technology stack cnn+bilstm+attention
[CV] target detection: derivation of common terms and map evaluation indicators
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
软件测试工程师必备之软技能:结构化思维
MySQL combat optimization expert 02 in order to execute SQL statements, do you know what kind of architectural design MySQL uses?
华南技术栈CNN+Bilstm+Attention
The appearance is popular. Two JSON visualization tools are recommended for use with swagger. It's really fragrant
Can I learn PLC at the age of 33
Routes and resources of AI
15 medical registration system_ [appointment registration]
随机推荐
14 medical registration system_ [Alibaba cloud OSS, user authentication and patient]
MySQL實戰優化高手08 生產經驗:在數據庫的壓測過程中,如何360度無死角觀察機器性能?
MySQL ERROR 1040: Too many connections
17 medical registration system_ [wechat Payment]
四川云教和双师模式
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
[untitled]
Const decorated member function problem
MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.
docker MySQL解决时区问题
简单解决phpjm加密问题 免费phpjm解密工具
Docker MySQL solves time zone problems
Mexican SQL manual injection vulnerability test (mongodb database) problem solution
MySQL实战优化高手02 为了执行SQL语句,你知道MySQL用了什么样的架构设计吗?
How to make shell script executable
Embedded development is much more difficult than MCU? Talk about SCM and embedded development and design experience
How to build an interface automation testing framework?
MySQL實戰優化高手04 借著更新語句在InnoDB存儲引擎中的執行流程,聊聊binlog是什麼?
软件测试工程师发展规划路线
Tianmu MVC audit II