当前位置:网站首页>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)
边栏推荐
- C杂讲 文件 续讲
- 13 medical registration system_ [wechat login]
- Bugku web guide
- Installation de la pagode et déploiement du projet flask
- Constants and pointers
- NLP路线和资源
- Mexican SQL manual injection vulnerability test (mongodb database) problem solution
- Compress decompress
- A necessary soft skill for Software Test Engineers: structured thinking
- C杂讲 动态链表操作 再讲
猜你喜欢
Security design verification of API interface: ticket, signature, timestamp
如何让shell脚本变成可执行文件
A necessary soft skill for Software Test Engineers: structured thinking
Super detailed steps to implement Wechat public number H5 Message push
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
16 medical registration system_ [order by appointment]
MySQL storage engine
15 medical registration system_ [appointment registration]
Some thoughts on the study of 51 single chip microcomputer
四川云教和双师模式
随机推荐
Automation sequences of canoe simulation functions
美疾控中心:美国李斯特菌疫情暴发与冰激凌产品有关
PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
MySQL实战优化高手06 生产经验:互联网公司的生产环境数据库是如何进行性能测试的?
If someone asks you about the consistency of database cache, send this article directly to him
Retention policy of RMAN backup
MySQL combat optimization expert 03 uses a data update process to preliminarily understand the architecture design of InnoDB storage engine
14 医疗挂号系统_【阿里云OSS、用户认证与就诊人】
Simple solution to phpjm encryption problem free phpjm decryption tool
MySQL实战优化高手07 生产经验:如何对生产环境中的数据库进行360度无死角压测?
docker MySQL解决时区问题
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
MySQL实战优化高手09 生产经验:如何为生产环境中的数据库部署监控系统?
Control the operation of the test module through the panel in canoe (primary)
17 医疗挂号系统_【微信支付】
Random notes
Tianmu MVC audit I
[untitled]
在CANoe中通过Panel面板控制Test Module 运行(初级)
How to build an interface automation testing framework?