Part III · Searching, Sorting and Selection
17. Elementary Sorting Algorithms
6 lessons•31 topics•Beginner / Intermediate
6 of 6 lessons published
17.011 animated
Sorting foundations
- Comparison sorting
- Key comparison
- Ascending/descending
- Stability
- In-place vs out-of-place
- Adaptive sort
17.021 animated
Bubble sort
- Repeated adjacent swaps
- Early-exit optimization
- Dry run
- Complexity
- Stability
17.032 animated
Selection sort
- Find minimum
- Minimum swaps
- Instability
- Dry run
- Complexity
17.043 animated
Insertion sort
- Sorted prefix invariant
- Shift vs swap
- Adaptive best case
- Stability
- Binary insertion sort
17.055 animated
Other educational sorts
- Cocktail shaker
- Comb sort
- Gnome sort
- Shell sort intro
- Cycle sort intro
17.062 animated
Sorting analysis
- Best/average/worst
- Comparisons vs swaps
- Sorted input
- Reverse input
- Duplicate keys