Skip to main content

10 docs tagged with "Sorting"

View all tags

Beyond Quadratic Sorting

Mergesort, the Omega(n log n) lower bound for comparison sorting, and what real sorting libraries use.

Bubble Sort

Bubble sort, inversions, sentinel optimization, and bidirectional (cocktail) bubble sort with traces and measurements.

Comparing Sorting Algorithms

Head-to-head complexity and empirical benchmarks of sorting algorithms, external sorting, and how to choose one in practice.

Exercises: Sorting

Exercises with solutions on simple sorts, Quicksort, merging, lower bounds, and algorithm selection.

Insertion Sort

Direct insertion sort, why it is adaptive on nearly sorted data, binary insertion sort, and empirical measurements.

Proofs: Sorting

Formal proofs for Chapter 2: correctness of sorting algorithms and the n log n comparison lower bound.

Quicksort

Partitioning, pivot selection with median-of-three, average vs. worst-case analysis, and practical engineering improvements.

Selection Sort

Direct selection sort, why it performs at most n - 1 swaps, why it is not stable, and when its few swaps make it useful.

Summary: Sorting

Chapter 2 summary: sorting criteria, complexity table at a glance, and practical selection guidelines.

The Sorting Problem

Formal statement of the sorting problem and the criteria to evaluate sorting algorithms: complexity, comparisons, swaps, stability, and memory.