Insertion: Empty sequence. Insert each item into right spot in sequence.
Selection: Select first element. If any > 1st, switch the two. Then select the second. etc etc etc
Merge: Split the list in two until you're left with two-element lists. Sort and merge with another two-element list. Keep going until you're done.
Quick: Pick a pivot (normally the first item). Move all > pivot items to the back and all < pivot itmes to the front. Recursively sort "small" array and "large" array using the same method.
Sort Method | Best Case | Worst Case |
---|---|---|
Insertion | O(n) | O(n^2) |
Selection | O(n^2) | O(n^2) |
Merge | O(nlogn) | O(nlogn) |
Quick | O(nlogn) | O(n^2) |