Algorithm Analysis

Algorithm analysis is the study of how much of a resource, usually running time or memory, an algorithm consumes as a function of the size of its input. The goal is to predict an algorithm’s behavior before running it and to compare competing algorithms on a fair footing, independent of any particular computer or programming language.

The central tool of the field is asymptotic, or big-O, analysis. Instead of measuring an algorithm in seconds on one machine, analysts count the number of basic steps an algorithm takes and describe how that count grows as the input gets large. This abstracts away hardware speed and focuses on the property that matters most for large inputs: whether the work grows linearly, quadratically, logarithmically, or otherwise with the input size.

This way of thinking was made rigorous largely by Donald Knuth. His The Art of Computer Programming derives exact mathematical formulas for the time and space used by the algorithms it presents, rather than settling for rough estimates, and his Stanford home page reflects a career built around this analytical approach. Knuth’s 1974 Turing Award recognized precisely this contribution to the field.

Analyzing algorithms is what turns programming from craft into science. By quantifying cost, it lets engineers choose the right algorithm for a problem, predict whether a program will scale, and understand why some approaches are practical while others are hopelessly slow even though both produce correct answers.

Sources

Last verified June 8, 2026