Beyond Quadratic Sorting
Mergesort, the Omega(n log n) lower bound for comparison sorting, and what real sorting libraries use.
Mergesort, the Omega(n log n) lower bound for comparison sorting, and what real sorting libraries use.
Bubble sort, inversions, sentinel optimization, and bidirectional (cocktail) bubble sort with traces and measurements.
Head-to-head complexity and empirical benchmarks of sorting algorithms, external sorting, and how to choose one in practice.
Exercises with solutions on simple sorts, Quicksort, merging, lower bounds, and algorithm selection.
Direct insertion sort, why it is adaptive on nearly sorted data, binary insertion sort, and empirical measurements.
Formal proofs for Chapter 2: correctness of sorting algorithms and the n log n comparison lower bound.
Partitioning, pivot selection with median-of-three, average vs. worst-case analysis, and practical engineering improvements.
Direct selection sort, why it performs at most n - 1 swaps, why it is not stable, and when its few swaps make it useful.
Chapter 2 summary: sorting criteria, complexity table at a glance, and practical selection guidelines.
Formal statement of the sorting problem and the criteria to evaluate sorting algorithms: complexity, comparisons, swaps, stability, and memory.