Computing complexity
Computational or algorithmic complexity is a measure of how the running time of an algorithm grows depending on the size of the inputs. This is a theoretical computation that is independent of the specific hardware or implementation. Computational complexity is the primary means of comparing the efficiency of different algorithms (for achieving the same aim). The analysis of algorithmic complexity can be rather tricky, so we won’t go into too much detail here.
Complexity is usually recorded in “big-oh” notation, such as
,
,
, and
. The number that appears here is the term that dominates the theoretical execution time for large enough
. Here,
represents constant complexity, where the operation takes a constant amount of time regardless of the size of the input;
means the running time is related to the size of the inputs in a linear manner. Quadratic complexity
means that the theoretical running time is dominated by the square of the...