Unit 4: Sorting

Sorting is the basic building block that many other algorithms are built around.

Sorting is one of the most studied problems in computer science — and for good reason. It appears repeatedly throughout algorithm design, not just as a standalone problem, but as a tool that unlocks solutions to entirely different problems.

Why Sorting Matters

circle-info

Most computer science students encounter sorting at least three times before graduating. This unit is that third encounter — the one where we ask why, not just how.

  • Foundation for other algorithms — a sorted structure enables faster search, deduplication, range queries, and more

  • A showcase of design paradigms — divide-and-conquer, data structures, and randomization all appear naturally in sorting algorithms

  • Deeply understood — dozens of algorithms exist, each with specific advantages depending on context

What We Cover

This unit treats sorting more like a data structure than a problem — something you reach for to make other tasks tractable. We examine four fundamental algorithms in depth:

Algorithm
Paradigm

Heapsort

Data structures (heaps)

Mergesort

Divide and conquer

Quicksort

Randomization

Distribution Sort

Bucketing / non-comparison

Last updated