算法空间/时间复杂度:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“== 常用的时间复杂度量级 == * 常数阶 <math>O(1)</math> * 对数阶 <math>O(\logn)</math> * 线性阶 <math>O(N)</math> * 线性对数阶 <math>O(n \times \logn)</math> * 平方阶 <math>O(n^2)</math> * 立方阶 <math>O(n^3)</math> * K 次立方阶 <math>O(n^k)</math> * 指数阶 <math>O(2^n)</math> * 乘阶 <math>O(n!)</math>”
 
Kangkk​(留言 | 贡献)
 
(未显示同一用户的3个中间版本)
第1行: 第1行:
== 常用的时间复杂度量级 ==
== 常用的时间复杂度量级 ==
* 常数阶 <math>O(1)</math>
* 常数阶 <math>O(1)</math>
* 对数阶 <math>O(\logn)</math>
* 对数阶 <math>O(\log n)</math>
* 线性阶 <math>O(N)</math>
* 线性阶 <math>O(N)</math>
* 线性对数阶 <math>O(n \times \logn)</math>
* 线性对数阶 <math>O(n \times \log n)</math>
* 平方阶 <math>O(n^2)</math>
* 平方阶 <math>O(n^2)</math>
* 立方阶 <math>O(n^3)</math>
* 立方阶 <math>O(n^3)</math>
第9行: 第9行:
* 指数阶 <math>O(2^n)</math>
* 指数阶 <math>O(2^n)</math>
* 乘阶 <math>O(n!)</math>
* 乘阶 <math>O(n!)</math>
<pre>Plot[{1, Log[x], x, x*Log[x], x^2, x^3, 2^x, x!}, {x, -30, 30}, PlotLegends -> "Expressions"]</pre>
[[文件:时间复杂度-1.png|400px|无|时间复杂度-1]]

2026年2月1日 (日) 16:28的最新版本

常用的时间复杂度量级

  • 常数阶 O(1)
  • 对数阶 O(log⁡n)
  • 线性阶 O(N)
  • 线性对数阶 O(n×log⁡n)
  • 平方阶 O(n2)
  • 立方阶 O(n3)
  • K 次立方阶 O(nk)
  • 指数阶 O(2n)
  • 乘阶 O(n!)


Plot[{1, Log[x], x, x*Log[x], x^2, x^3, 2^x, x!}, {x, -30, 30}, PlotLegends -> "Expressions"]
时间复杂度-1
时间复杂度-1