当前位置:网站首页>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)
边栏推荐
- Notes of Dr. Carolyn ROS é's social networking speech
- MySQL combat optimization expert 12 what does the memory data structure buffer pool look like?
- Flash operation and maintenance script (running for a long time)
- The programming ranking list came out in February. Is the result as you expected?
- 安装OpenCV时遇到的几种错误
- Use xtrabackup for MySQL database physical backup
- vscode 常用的指令
- MySQL real battle optimization expert 11 starts with the addition, deletion and modification of data. Review the status of buffer pool in the database
- Installation de la pagode et déploiement du projet flask
- CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
猜你喜欢

再有人问你数据库缓存一致性的问题,直接把这篇文章发给他

颜值爆表,推荐两款JSON可视化工具,配合Swagger使用真香

AI的路线和资源

解决在window中远程连接Linux下的MySQL

CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?

Some thoughts on the study of 51 single chip microcomputer

寶塔的安裝和flask項目部署

CAPL 脚本对.ini 配置文件的高阶操作

Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)

The underlying logical architecture of MySQL
随机推荐
Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
13 medical registration system_ [wechat login]
[flask] crud addition and query operation of data
The replay block of canoe still needs to be combined with CAPL script to make it clear
Can I learn PLC at the age of 33
Several silly built-in functions about relative path / absolute path operation in CAPL script
MySQL实战优化高手10 生产经验:如何为数据库的监控系统部署可视化报表系统?
docker MySQL解决时区问题
A necessary soft skill for Software Test Engineers: structured thinking
C miscellaneous two-way circular linked list
宝塔的安装和flask项目部署
Automation sequences of canoe simulation functions
Hugo blog graphical writing tool -- QT practice
[one click] it only takes 30s to build a blog with one click - QT graphical tool
cmooc互联网+教育
[untitled]
Delayed note learning
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
Implement context manager through with
颜值爆表,推荐两款JSON可视化工具,配合Swagger使用真香