1 / 8

DSA · Big O & problem solving

Big O describes growth

Let n be the size of the input. Big O describes how an algorithm's resource use grows as n grows. It is not a stopwatch reading: hardware, runtime, and input values change elapsed time.

For example, a loop that visits every item performs work proportional to n. Doubling the input roughly doubles that work, so its growth is O(n).