Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Big O notation


 Contents
In complexity theory, computer science, and mathematics the Big O notation is a mathematical notation used to describe the asymptotic behavior of functions. More exactly, it is used to describe an asymptotic upper bound for the magnitude of a function in terms of another, usually simpler, function.

It was first introduced by German number theorist Paul Bachmann in his 1892 book Analytische Zahlentheorie. The notation was popularized in the work of another German number theorist Edmund Landau, hence it is sometimes called a Landau symbol. The O was originally a capital omicron; today the capital letter O is used, but never the digit

zero.

Omega and theta notation are also used for approximating formulae (see sum), analyzing algorithms (see heapsortHeapsort is one of the best general-purpose sort algorithms, and is part of the selection sort family. Although somewhat slower in practice on most machines than a good implementation of quicksort, it has the advantages of worst-case O n log n runtime and), and for defining terms in complexity theory (see polynomial timeIn computational complexity theory, Polynomial time refers to the computation time of a problem where the time, m ''n , is no greater than a polynomial function of the problem size, n''. Written mathematically, m ''n O n k where k is a constant (which may).

1 Uses

There are two formally close, but noticeably different usages of this notation: infinite asymptotics and infinitesimalCalculus In mathematics, an infinitesimal or infinitely small number, is a number that is greater in absolute value than zero yet smaller than any positive real number. A number x ≠ 0 is an infinitesimal iff every sum x +. x of finitely many terms is l asymptotics. This distinction is only in application and not in principle, however—the formal definition for the "big O" is the same for both cases, only with different limits for the function argument.

1.1 Infinite asymptotics

Big O notation is useful when analyzing algorithmsTo analyze an algorithm is to determine the amount of resources (such as time and storage) necessary to execute it. Most algorithms are designed to work with inputs of arbitrary length. Usually the efficiency or complexity of an algorithm is stated as a f for efficiency. For example, the time (or the number of steps) it takes to complete a problem of size n might be found to be T(n) = 4n2 - 2n + 2.

As n grows large, the n2 term will come to dominate, so that all other terms can be neglected. Further, the

coefficientIn mathematics, a coefficient is a multiplicative factor that belongs to a certain object such as a variable, a basis vector, a basis function and so on. Usually, the objects and the coefficients are indexed in the same way, leading to expressions such ass will depend on the precise details of the implementation and

the hardware it runs on, so they should also be neglected. Big O notation captures what remains: we write

and say that the algorithm has order of n2 time complexity.



Read more »

Non User