Insertion Sort (Cont.)
Data dependent performance...
If a is sorted, n - 1 data comparisons are used.
In the worst case, n(n-1)/2 are used.
Multiple runs with random data would afford a good estimate of the average-case running time.
Previous slide
Back to first slide
View graphic version