Big O notation, also known as asymptotic notation, is a way of summarizing the performance of algorithms based on problem size. The problem size is usually designated *n*. The “Big O”-ness of an algorithm is often referred to as its complexity. The term asymptotic is used as it describes the behavior of a function as its input size approaches infinity.

As an example, consider an unsorted array that contains a value we need to search for. Because it is unsorted, we will have to search every element until we find the value we are looking for. If the array is of size *n*, we will need to search, worst case, *n* elements. We say, therefore, that this linear search algorithm has a complexity of O(n).

That is the worst case. On ...

Start Free Trial

No credit card required