All courses › Intermediate Programming › Time complexity, O-notation
Time complexity, O-notation
O-notation describes how an algorithm's running time grows with the number of elements , for large . is constant, grows slowly, linearly and quadratically. This is what determines whether an algorithm can handle large amounts of data.
typical order, fastest to slowest
Symbols
| number of elements |
Example
Lookup in a dict is : almost independent of size.
Binary search in a sorted list is : the search space halves each step.
Doubling in an algorithm quadruples the running time — not just doubles it.
Practise algorithms and data structures for free →
Part of Intermediate Programming: Algorithms and data structures.