Orders of Common Functions
Further information: Time complexity#Table of common time complexitiesHere is a list of classes of functions that are commonly encountered when analyzing the running time of an algorithm. In each case, c is a constant and n increases without bound. The slower-growing functions are generally listed first.
| Notation | Name | Example |
|---|---|---|
| constant | Determining if a number is even or odd; using a constant-size lookup table | |
| double logarithmic | Finding an item using interpolation search in a sorted array of uniformly distributed values. | |
| logarithmic | Finding an item in a sorted array with a binary search or a balanced search tree as well as all operations in a Binomial heap. | |
| fractional power | Searching in a kd-tree | |
| linear | Finding an item in an unsorted list or a malformed tree (worst case) or in an unsorted array; Adding two n-bit integers by ripple carry. | |
| n log-star n | Performing triangulation of a simple polygon using Seidel's algorithm. (Note ![]() |
|
| linearithmic, loglinear, or quasilinear | Performing a Fast Fourier transform; heapsort, quicksort (best and average case), or merge sort | |
| quadratic | Multiplying two n-digit numbers by a simple algorithm; bubble sort (worst case or naive implementation), Shell sort, quicksort (worst case), selection sort or insertion sort | |
| polynomial or algebraic | Tree-adjoining grammar parsing; maximum matching for bipartite graphs | |
| L-notation or sub-exponential | Factoring a number using the quadratic sieve or number field sieve | |
| exponential | Finding the (exact) solution to the travelling salesman problem using dynamic programming; determining if two logical statements are equivalent using brute-force search | |
| factorial | Solving the traveling salesman problem via brute-force search; generating all unrestricted permutations of a poset; finding the determinant with expansion by minors. |
The statement is sometimes weakened to to derive simpler formulas for asymptotic complexity. For any and, is a subset of for any, so may be considered as a polynomial with some bigger order.
Read more about this topic: Big O Notation
Famous quotes containing the words orders of, orders, common and/or functions:
“One cannot be a good historian of the outward, visible world without giving some thought to the hidden, private life of ordinary people; and on the other hand one cannot be a good historian of this inner life without taking into account outward events where these are relevant. They are two orders of fact which reflect each other, which are always linked and which sometimes provoke each other.”
—Victor Hugo (18021885)
“Ive got orders to obey, thank God.”
—Robert Bolt (19241995)
“The difference between human vision and the image perceived by the faceted eye of an insect may be compared with the difference between a half-tone block made with the very finest screen and the corresponding picture as represented by the very coarse screening used in common newspaper pictorial reproduction. The same comparison holds good between the way Gogol saw things and the way average readers and average writers see things.”
—Vladimir Nabokov (18991977)
“In todays world parents find themselves at the mercy of a society which imposes pressures and priorities that allow neither time nor place for meaningful activities and relations between children and adults, which downgrade the role of parents and the functions of parenthood, and which prevent the parent from doing things he wants to do as a guide, friend, and companion to his children.”
—Urie Bronfenbrenner (b. 1917)
