Search⌘ K
AI Features

Big O Notation

Explore Big O notation and its role in measuring algorithm efficiency. Understand worst-case, best-case, and average-case complexities using asymptotic notations. Learn about amortized time complexity to analyze performance over sequences of operations and improve algorithm design.

Standard notation of time complexity

We know how we can represent any algorithm through the order of nn or input. Big O notation is the most convenient way to express the worst-case scenario for an algorithm.

Consider a code where we use the sqrt(Range) algorithm. The Big O notation is O(n)O(\sqrt{n}) for this case. This algorithm couldn’t be worse than anything.

Consider another code where we have to iterate over one million times if nn is 1000003. The Big O notation is O(n)O(n) for ...