← Analysing an area of computer science

Complexity and tractability (2025)

The most self-contained area, and the easiest to evidence with worked figures.

Growth rates worth quoting

Binary search O(log n) 1 000 000 items ≈ 20 comparisons Linear search O(n) Doubling the data doubles the work Efficient sorts (merge, quick average) O(n log n) The practical ceiling for comparison sorting Bubble / insertion sort O(n²) Doubling the data quadruples the work Travelling salesman, brute force O(n!) (n−1)!/2 tours: 20 cities > 10¹⁶ routes Exam-style Why time complexity matters to developers Discuss its importance. It predicts behaviour at SCALE, before the data exists: an O(n²) algorithm fine on 100 test records is unusable on 100 000 live ones. It separates the algorithm from the hardware: a faster machine improves the constant, never the growth rate, so you cannot buy your way out of a bad complexity class. It guides the choice between exact and approximate: if the problem is intractable, the right decision is a heuristic, and knowing the class is what tells you that. It has a cost and sustainability dimension: exponential work means energy and cloud spend growing the same way. ✓ Prediction, hardware-independence, the exact-vs-approximate decision, and cost. Four distinct reasons, each with a consequence.

Practise just this