Punch Line

By this analysis, index sort runs in O(n)... no wonder it runs so fast!

The basic idea is that we find something that changes on each iteration (either i is incremented, or at least one new item is put in its place). This gives us a way to bound the total work before the algorithm terminates.


next up previous
Next: EXAMPLES Up: POTENTIAL FUNCTION ANALYSIS Previous: Analysis of Permutation Problem