Common Examples of Asymptotic Running Times

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

posted on 2012-08-18 09:42  grep  阅读(164)  评论(0编辑  收藏  举报