Python
Complexity and Choosing Data Structures
Big-O describes how work grows with input size. Choosing the right container is worth more than every micro-optimisation combined.
Complexity, choosing the right data structure, timeit, cProfile and practical optimisation.
3 notes
Big-O describes how work grows with input size. Choosing the right container is worth more than every micro-optimisation combined.
Measure before optimising. Guessing where a program spends its time is wrong often enough that the habit is worth breaking permanently.
Once the algorithm is right, a handful of techniques reliably help: build less, look up less, let C do the loop, and cache what repeats.