当前位置:网站首页>time complexity and space complexity
time complexity and space complexity
2022-08-05 06:14:00 【CrazyQiQi】
Time and space complexity
1. Time complexity of the algorithm
Concept: When performing algorithm analysis, the total number of executions of the statement T(n) is a function of the problem size n, and then analyze the change of T(n) with n and determine the order of magnitude of T(n).
Formula: T(n)=O(f(n)), f(n) is some function of problem size n
Common time complexity
| Example | Time Complexity | Terms |
|---|---|---|
| 5201314 | O(1) | Constant order |
| 3n+4 | O(n) | Linear order |
| 3n^2+4 | O(n^2) | Square order |
| 3log(2)n+4 | O(logn) | Logarithmic |
| 2n+3nlog(2)n+4 | O(nlogn) | nlogn order |
| n3+2n2+4n+3 | O(n^3) | Cubic order |
| 2^n | O(2^n) | Exponential order |
Time spent in common time complexity
2. Space complexity of the algorithm
Concept: The space complexity of the algorithm is realized by calculating the storage space required by the algorithm
Calculation formula: S(n) = O(f(n)), where n is the problem size and f(n) isStatement about the function of the storage space occupied by n
边栏推荐
- Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
- 什么?CDN缓存加速只适用于加速静态内容?
- 【Day8】磁盘及磁盘的分区有关知识
- Image compression failure problem
- NIO works is analysed
- 监控系统的内卷,有什么讲究?
- 入门文档06 向流(stream)中添加文件
- Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
- 腾讯云云函数SCF—入门须知
- CIPU,对云计算产业有什么影响
猜你喜欢

Hugo搭建个人博客

Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system

【Day8】使用LVM扩容所涉及的命令

IP packet format (ICMP protocol and ARP protocol)

OpenCV3.0 is compatible with VS2010 and VS2013

Dsf5.0 bounced points determine not return a value

错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘

Transport layer protocol (TCP 3-way handshake)

lvm logical volume and disk quota

Autoware--北科天绘rfans激光雷达使用相机&激光雷达联合标定文件验证点云图像融合效果
随机推荐
NIO works is analysed
Mongodb查询分析器解析
The Servlet to jump to the JSP page, forwarding and redirection
ROS video tutorial
spark源码-任务提交流程之-1-sparkSubmit
Autoware中安装Yolo3目标检测模块遇到的问题
spark源码-任务提交流程之-7-流程梳理总结
The spark operator - coalesce operator
海外服务器的优势
入门文档10 资源映射
[Day5] Soft and hard links File storage, deletion, directory management commands
Small example of regular expression--validate email address
Spark source code - task submission process - 4-container to start executor
spark operator-parallelize operator
腾讯云消息队列CMQ
spark source code-RPC communication mechanism
NIO工作方式浅析
static routing
【Day8】磁盘及磁盘的分区有关知识
快问快答—腾讯云服务器常见问题解答