TAOCP Vol 3: Sorting and Searching · Week 104
TAOCP 5.4.4 Reading Tape Backwards
Updated
Summary
TAOCP 5.4.4 Reading Tape Backwards: Merge patterns that avoid rewinding by reading tapes backward, which flips the order of runs and changes the bookkeeping. Budget about 3 hours; do exercises 6, 1 and 3.
This week's steps
3 stepsRead §5.4.4 Reading Tape Backwards
Skim for the idea.
Start with Ex 6, Ex 1, Ex 3; 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.
Sign in to track this: tick each step off and it counts toward your week.
Exercises
This section has 26 exercises, rated 07 to M46, and Knuth marks 7 of them with the triangle for recommended. The second half of this section (Karp's tree model of merge patterns, fifo and lifo trees) is the lasting idea; do 19 and 20 to see it. 10 and 14 are big projects, and 16 and 26 are research problems.
Worth your time
Exercise 320▶ Recommended
Show read-backward polyphase ends with an ascending run on the right tape.
Exercise 1120▶ Recommended
True or false: backward-reading merges must alternate ascending and descending runs.
Exercise 1728▶ Recommended
Design an initial distribution for read-backward cascade that ends in ascending order. The stretch.
Your log
Sign in to log the exercises you work: number, rating, how far you got.
Your notes
Only youSign in to keep private notes on this guide, in Markdown. They stay yours: never on your profile, and you can export them all.
Discussion
0 postsQuestions about the reading go here; each exercise has its own thread below. Hints over answers.
No posts yet. Ask a question or share a tip.
Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise threads
One thread per exercise. Open one to ask for a nudge or check your thinking.
Exercise 117No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 320No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 523No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 607No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 1120No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 1728No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 1922No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Exercise 2022No posts yet
Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler:
||like this||or a```spoilerblock.Sign in to postAnyone can read. Posting needs an account with a confirmed email.
Reference
Why it matters
Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.
Before you start
- 5.4.2 The Polyphase Merge
How to approach it
Skim for the idea. Use the spare time on 5.4.1 or on earlier Vol 3 exercises.