Data Structures

Big O Notation

Definition

A mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms