Asymptotic Estimates for the Higher Moments of the Expected Behavior of Straight Insertion Sort

The complexity of this algorithm is obviously determined by the number of downward moves, i.e., the number of times the while-loop is executed, and it is well known that this happens in the worst case in(n 1) times, and an(n 1) times on the average, provided the inputs are chosen from {l,..., n) such that every permutation has the same probability to occur (see [4, p. 821). It is shown in [2] that the same expected behavior will be observed if the average case analysis is done with a continuous model and a symmetric input ldistribution. Denote by W(n) the number of times the while-loop is executed; then it is well known that the probability generating function