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 |