AP-Computer-Science ScienceAP
Time Complexity Time Complexity
Big O notation describes an asymptotic upper bound on how an algorithm’s work grows with input size . It does not measure an exact number of seconds.
| Growth | Notation |
|---|---|
| Constant | |
| Logarithmic | |
| Linear | |
| Quadratic | |
| Exponential |
Binary search
Binary search repeatedly halves the remaining range in a sorted list. Its worst-case number of iterations grows on the order of .
Review clarification
The original expression describes the growth rate, not the exact integer number of steps for every implementation and input. For example, a standard inclusive-bound search of a nonempty list takes at most iterations.