| Complexity | Name | Examples, Comments |
| Θ(1) | Constant | Hash table lookup and modification |
| Θ(lgn) | logarithmic | Binary Search |
| Θ(n) | Linear | iterating over a list |
| Θ(nlgn) | LogLinear | Optimal sorting of arbitrary values |
| Θ(n2) | Quadratic | Comparing n objects to each other( all against all) |
| Θ(n3) | Cubic | Floyd and Warshall's algorithms |
| Θ(nk) | Polynomial | k nested for loops over n |
| Θ(kn) | Exponential | Producing every subset of n items |
| Θ(n!) | Factorial | Producing every ordering of n values |
转载于:https://www.cnblogs.com/grep/archive/2012/08/18/2645091.html
本文详细介绍了算法复杂度的种类,包括常数复杂度、对数复杂度、线性复杂度、对数线性复杂度、多项式复杂度、二次复杂度等,并通过实例解释了每种复杂度的特点。
1916

被折叠的 条评论
为什么被折叠?



