Table of common time complexities
The following table summarizes some classes of commonly encountered time complexities. In the table, poly( x ) = x O (1), i.e., polynomial in x . Name Complexity class Running time ( T ( n )) Examples of running times Example algorithms constant time O (1) 10 Finding the median value in a sorted array of numbers Calculating (−1) n inverse Ackermann time O ( α ( n )) Amortized time per operation using a disjoint set iterated logarithmic time O (log * n ) Distributed coloring of cycles log-logarithmic O (log log n ) Amortized time per operation using a bounded priority queue logarithmic time DLOGTIME O (log n ) log n , log( n 2) Binary search polylogarithmic time poly(log n ) (log n )2 fractional power O ( n c) where 0 < c < 1 n 1/2, n 2/3 Searching in a kd-tree linear time O ( n ) n , 2n + 5 Finding the smallest or largest item in an unsorted array, Kadane's algorithm, linear search "n log-star n" ti...