
Effi ciency of Algorithms 375
14.2.1 Probabilistic Average Case Analysis
Consider, as an example, that we wish to characterise the behaviour of an algorithm that linearly searches an
ordered list of elements for some particular value, say x.
1 2 3 4 ........... n
For the worst case, it will be necessary for the algorithm to analyse or examine all values in the list
before terminating. But, we are interested in analysis of the average case behaviour, where it is assumed that
all possible points of termination are equally likely that is, the probability that x will be found at position 1 is
1/n, that it will be found at position 2 is 1/n, and so ...