It is very common to apply sorting algorithms to lists with small
insertion indices. Example?
Insertion sort is nice because it runs fast for lists with small
insertion indices.
- Given a list with insertion index k, how many times will
insertion sort have to bubble an item into place?
- What's the maximum work that it takes to bubble a single item into
place?
- This gives a O(kn+n) bound. In the homework, you'll show that
this bound is not tight.
Next: An Assortment of Sorts
Up: INSERTION SORT
Previous: Measures of Sortedness