
Insertion, Selection, Bubble and Inversions
Insertion, selection and bubble sort as code-level procedures, traced pass by pass on one array with every state, comparison and swap counted by script; exact best and worst counts; inversions and why insertion shifts and bubble swaps both equal the inversion count; the exact comparison count of insertion sort; the number of bubble passes; stability with a counterexample for selection sort; adaptivity, online behaviour and counts on sorted, reversed and equal inputs.



