# TAOCP 5.4.7 External Radix Sorting

> Study guide to TAOCP 5.4.7 External Radix Sorting. Doing radix sort on data that lives on external storage, distributing into files by digit.

Updated October 20, 2026.

## Summary {#summary}

TAOCP 5.4.7 External Radix Sorting: Doing radix sort on data that lives on external storage, distributing into files by digit. Budget about 3 hours; do exercises 5, 1 and 6.

## Key facts {#key-facts}

- Week 106 of 145 on the cracked.guide path, in [TAOCP Vol 3: Sorting and Searching](https://cracked.guide/taocp/volume-3).
- Time budget: about 3 hours.
- 7 exercises in the section, rated 15 to M35; the guide picks 5.
- Picked exercises with Knuth's triangle for recommended: 6.
- Before you start: 5.2.5 Sorting by Distribution.

## Week 106 goals {#objectives}

By the end of week 106 you can:

- Explain how external radix sorting distributes records into files by digit.
- Compare external radix sorting with the shuffle phase of MapReduce.
- Explain why sorting with only two tapes needs many extra passes.

## This week's steps {#steps}

- Read §5.4.7 External Radix Sorting: Skim and connect it to the shuffle phase of MapReduce or Spark.
- Work the exercises (5 picked): Start with Ex 5, Ex 1, Ex 6; log what you solve below.
- Write down one thing you'd explain to someone: A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.

## Exercises {#exercises}

This section has 7 exercises, rated 15 to M35, and Knuth marks 1 of them with the triangle for recommended. A small set. Do 5 and 6 to get comfortable with the duality between radix sorting and merging that the section is built on.

Worth your time:

- 5 (rated 15): Draw the merge tree that corresponds to Mauchly's backward radix sort.
- 1 (rated 20): Show balanced merging is a radix sort in a mixed-radix number system.
- 6 (rated 20, recommended): Run Mauchly's tape radix sort twice and predict the final order.
- 7 (rated 21): Does the merge/radix duality carry over to multireel files?
- 4 (rated M23): Prove Ashenhurst's pattern is optimal for ten keys on four tapes. The math one.

## Why it matters {#why}

Distribution-based external sorts are how many big-data systems partition data (think MapReduce shuffles).

## Before you start {#before}

- 5.2.5 Sorting by Distribution

## How to approach it {#approach}

Skim and connect it to the shuffle phase of MapReduce or Spark.

## Links {#links}

- [Knuth's TAOCP page (editions, errata, MIX/MMIX)](https://www-cs-faculty.stanford.edu/~knuth/taocp.html)
- [Vol 3 errata (plain text, from Knuth)](https://www-cs-faculty.stanford.edu/~knuth/err3.textxt)
- [Wikipedia: MapReduce](https://en.wikipedia.org/wiki/MapReduce)

---

Source: https://cracked.guide/guide/knuth-w088-1
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
