Algorithm Big(O) Notation All In One
作者:互联网
Algorithm Big(O) Notation All In One
算法复杂度 - 大O 表示法
时间复杂度:
程序的执行时间长短
空间复杂度:
内存占用空间大小
算法优化 / 性能优化
Big(O) Notation
Function | Big(O) Notation | 中文说明 |
---|---|---|
Constant | O(c) | const 常量,取 1 ~ n |
Logarithmic | O(log(n)) | n 的对数次幂 |
Linear | O(n) | n 次 |
Quadratic | O(n^2) | n 的 2 次方(平方) |
Cubic | O(n^3) | n 的 3 次方(立方) |
Exponential | O(2^n) | 2 的 n 次方(次幂) |
Factorial | O(n!) | n 的阶乘 |
Big(O) Notation Complexity Graph
O(
1
) < O(log(n)
) < O(n
) < O(n * log(n)
) < O(n^2
) < O(n^3
) < O(2^n
) < O(n!
)
https://www.bigocheatsheet.com/
refs
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/yI38pTGwcxg?start=4" title="YouTube video player" width="560"></iframe>https://algodaily.com/lessons/understanding-big-o-and-algorithmic-complexity
2022 最新字节跳动前端面试算法题 All In One
https://www.cnblogs.com/xgqfrms/p/16372741.html
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载
标签:www,Notation,Algorithm,Big,复杂度,xgqfrms,com 来源: https://www.cnblogs.com/xgqfrms/p/16383617.html