Table of Contents#### Download Safari Books Online apps: Apple iOS | Android | BlackBerry

### Understanding Algorithmic Complexity

#### Examples of Algorithmic Complexity

Entire Site

Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Algorithmic complexity is a measure of how much computation a program will perform when using a particular algorithm. It is a measure of its efficiency and estimate of operation count. It is not a measure of the complexity of the code necessary to implement a particular algorithm. An algorithm with low algorithmic complexity is likely to be more difficult to implement than an algorithm with higher algorithmic complexity. The most important fact is that the algorithmic complexity is not a model of the execution time but a model of the way execution time changes as the size of the input changes. It is probably best to illustrate this through some examples.

Suppose you want to write a program that sums the first N numbers. You would probably write something like the code shown in Listing 2.1.