#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck column:4
#columns:Front	Back	Tags	Deck
TAOCP Vol 3: Sorting and Searching: what is the phase about?	The most directly practical volume. Chapter 5 covers sorting: the combinatorics of permutations, every classic internal sort with exact analysis, lower bounds, sorting networks and external sorting. Chapter 6 covers searching: binary search, balanced trees, B-trees, tries, hashing and secondary keys. You will finish it able to read any database or standard library internals. Jonathan Blow put it this way in [a clip](https://www.youtube.com/watch?v=TxCB-GBpmIQ) that helped inspire this path: &quot;If you actually go through [Volume 3] for real, you will know way more data structures than anyone with a CS degree.&quot; For real means the exercises too.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: what should you be able to do by the end?	<ul><li>Implement and analyze quicksort, heapsort, merge sort, radix sort and Shellsort.</li><li>Explain why comparison sorting needs about n lg n comparisons.</li><li>Build AVL trees, B-trees, tries and hash tables, and predict their performance.</li><li>Design an external sort for data that does not fit in memory.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: what do you need before you start?	<ul><li>Vols 1 and 2, especially 1.2 math and 2.3 trees.</li><li>Your clox hash table (chapter 20) as a reference point for 6.4.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::need	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: how do you get the book?	Vol 3, 2nd edition is about $64 new from InformIT. The 1st edition (1973) is fine and often very cheap used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::book	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: tips for getting through it?	<ul><li>The tape-sorting sections (5.4.2 to 5.4.8) are mostly historical; skim them and spend the time on 5.4.1 and 5.4.9.</li><li>Build one shared benchmark harness for all your sorts.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::tips	cracked.guide::TAOCP Vol 3::About this phase
TAOCP §5.1.1 Inversions: what does it cover?	An inversion is a pair of elements that are out of order. Knuth studies the inversion table of a permutation, which encodes it uniquely, and counts how many permutations have a given number of inversions, with generating functions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: why does it matter?	The number of inversions is exactly how much work insertion sort and bubble sort do, and counting inversions is a classic merge-sort interview problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, fill in the blank:<br>Then count inversions in <span class="cg-blank">&nbsp;</span> with a modified merge sort.	Then count inversions in <b>O(n log n)</b> with a modified merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, a common trap: “There are several conventions for inversion tables.” What's the catch?	Stick to Knuth's within this volume.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 1 (rated 10): what is it asking?	Convert a permutation to its inversion table and back by hand. Five minutes, and it fixes the convention for the whole chapter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 4 (rated 20, recommended): what is it asking?	Rebuild a permutation from its inversion table with a linked list. Implement it; you will use it to test exercise 6.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 6 (rated 26, recommended): what is it asking?	Compute the inversion table in n log n time. The same divide-and-conquer idea as counting inversions with merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 9 (rated M21, recommended): what is it asking?	A neat characterization of involutions using two of the alternative inversion tables from exercise 7. Read 7 first.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 13 (rated M23): what is it asking?	Show that inversion counts are evenly spread modulo m once n is at least m. Generalizes the even/odd split of permutations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 21 (rated M25, recommended): what is it asking?	Which permutations a stack can produce, described with an inversion-table condition. Ties back to the railway problems in Vol 1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 28 (rated 25, recommended): what is it asking?	Bound the total distance elements sit from home in terms of the inversion count. Useful intuition for why insertion sort is quadratic.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 25 (rated M30, recommended): what is it asking?	Build the Foata bijection that trades the index of a permutation for its inversion count. The stretch; give it a fixed time box.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: how many exercises, and how are they rated?	29 exercises, rated 10 to M43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: what should you be comfortable with first?	<ul><li>1.2.5 Permutations</li><li>1.2.9 Generating Functions</li><li>1.3.3 Applications to Permutations</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: how should you work through it?	Compute inversion tables for several permutations of 1..5 by hand and convert back. Write code for both directions. Then count inversions in O(n log n) with a modified merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.2 Permutations of a Multiset: what does it cover?	Permutations where elements can repeat, and an algebraic product on them (the intercalation product) that lets Knuth prove facts about factoring permutations into cycles in a unified way.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: why does it matter?	Sorting with duplicate keys is the normal case in practice. This section is fairly abstract, though; the practical payoff is mostly the mental model.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, a common trap: “Trying to rush through the abstract algebra.” What's the catch?	It only clicks with examples.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 2 (rated 10): what is it asking?	Compute an intercalation product with the factors swapped. Shows directly that the product does not commute.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 6 (rated M15): what is it asking?	Count two-letter strings by how often a b sits right before an a. A warm-up in counting multiset permutations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 8 (rated 20, recommended): what is it asking?	List every way to split the running example into two factors. Hand practice with the product's definition.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 15 (rated M25, recommended): what is it asking?	Decide when a multiset permutation is a single cycle by looking at a small directed graph.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 17 (rated M24): what is it asking?	Mean and spread of the inversion count for a random multiset permutation. Uses the generating function from 16, so read that statement first.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 11 (rated M26, recommended): what is it asking?	Show that counting prime factorizations is the same as counting topological sorts. Links this section to Vol 1's 2.2.3.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 10 (rated M30, recommended): what is it asking?	True or false: an ordering on the primes can make factorization unique. The stretch; the answer is subtle.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: how many exercises, and how are they rated?	24 exercises, rated M05 to M35.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: how should you work through it?	Read the definitions with lots of small examples. The intercalation product is unusual; work several products by hand before reading the theorems. Accept a slower pace here.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.3 Runs: what does it cover?	Ascending runs in a permutation, the Eulerian numbers that count permutations by number of runs, and the distribution of run lengths in random data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: why does it matter?	Natural merge sort and Timsort exploit runs in real data. Knowing how long runs are in random input tells you when that pays off.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, a common trap: “Confusing runs up with alternating runs (up-down sequences).” What's the catch?	They are different statistics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 13 (rated 05): what is it asking?	Average number of piles in a card-game version of runs. A quick check that you can use the main formula.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 6 (rated M21, recommended): what is it asking?	Find the flaw in a bogus derivation that n! equals zero. Good practice spotting an illegal swap of sums.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 2 (rated M22, recommended): what is it asking?	Prove a generalization of the identity that expresses powers through Eulerian numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 15 (rated M21, recommended): what is it asking?	Alternating up-and-down runs, the older notion of a run. Set up the counting and compare with ordinary runs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 20 (rated M21, recommended): what is it asking?	Connect runs to the number of left-to-right passes needed to read a permutation in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 27 (rated M21, recommended): what is it asking?	Show that Eulerian numbers also count increasing forests by their leaves. A clean bijection.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 19 (rated M26, recommended): what is it asking?	Count rook placements on a chessboard by how many fall below the diagonal. Eulerian numbers show up unexpectedly.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 29 (rated M30, recommended): what is it asking?	Count permutations by peaks and relate them to alternating runs. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: how many exercises, and how are they rated?	29 exercises, rated 05 to HM42.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li><li>1.2.6 Binomial Coefficients</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: how should you work through it?	Generate random permutations and histogram the run lengths, then compare with the formulas. Build a small table of Eulerian numbers by recurrence.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.4 Tableaux and Involutions: what does it cover?	Young tableaux, a correspondence between permutations and pairs of tableaux (Robinson-Schensted), the hook length formula for counting tableaux, and involutions (permutations that are their own inverse).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: why does it matter?	The correspondence gives a slick way to find the longest increasing subsequence, a common interview and diff-algorithm topic. It is also one of the most beautiful bijections in combinatorics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, a common trap: “Bumping into the wrong row during insertion.” What's the catch?	Trace carefully with pencil.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 1 (rated 16): what is it asking?	Run the tableau correspondence forward and backward on a small example. Essential before anything else here.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 8 (rated M18): what is it asking?	The classic result that a long enough sequence must contain a long monotone subsequence. Follows quickly from 7.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 7 (rated M20): what is it asking?	Show that the tableau's shape gives the longest increasing and decreasing subsequences. The practical heart of the section.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 3 (rated M24, recommended): what is it asking?	An alternative table-based way to carry out the correspondence. Easier to implement than the bumping description.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 20 (rated M24, recommended): what is it asking?	Count increasing labelings of a tree with a hook-length style product. A gentle cousin of the hook formula.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 42 (rated 30, recommended): what is it asking?	Sort genes with reversal flips and show one example needs five. An applied puzzle from genome comparison.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 5 (rated M22, recommended): what is it asking?	Show that reversing a permutation transposes its tableau. Uses the result of exercise 4.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 4 (rated M30, recommended): what is it asking?	Characterize which adjacent swaps leave the tableau unchanged. The stretch, and it unlocks exercise 5.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: how many exercises, and how are they rated?	44 exercises, rated M08 to HM43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: how should you work through it?	Implement the insertion procedure that builds the tableau from a permutation, and check that the length of the first row equals the longest increasing subsequence length. Verify the hook length formula on small shapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.2.1 Sorting by Insertion: what does it cover?	Straight insertion, binary insertion, Shellsort with diminishing increments, list insertion, and address-calculation sorting, each with careful analysis.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: why does it matter?	Insertion sort is what fast library sorts use for small subarrays. Shellsort is still a practical choice in embedded code with no recursion.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, fill in the blank:<br>Using binary insertion and expecting big wins on arrays: moves still cost <span class="cg-blank">&nbsp;</span>.	Using binary insertion and expecting big wins on arrays: moves still cost <b>O(n^2)</b>.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, a common trap: “Shellsort performance depends hugely on the increment sequence.” What's the catch?	Do not use powers of two.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: what traps should you watch for?	<ul><li>Using binary insertion and expecting big wins on arrays: moves still cost O(n^2).</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 1 (rated 10): what is it asking?	Is straight insertion stable? One-line answer, but say why.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 4 (rated M20, recommended): what is it asking?	Best and worst running time of the MIX straight insertion program. Ties the code to the inversion count.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 13 (rated M16, recommended): what is it asking?	Put the inversion-counting weights on the other edges of the lattice path. Quick, and it makes the picture click.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 10 (rated 22, recommended): what is it asking?	Skip shellsort's wasted work when an element is already in place, and judge whether it pays off.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 25 (rated M22, recommended): what is it asking?	Count permutations that are both 2-ordered and 3-ordered. The fact behind fast shellsort increment sequences.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 33 (rated 25, recommended): what is it asking?	Speed up list insertion with a sentinel so the inner loop does less work. A classic micro-optimization.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 31 (rated 25, recommended): what is it asking?	Write Pratt's shellsort (increments of the form 2^p 3^q) in MIX and express its running time.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 5 (rated M27, recommended): what is it asking?	Full probability distribution of straight insertion's running time. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: how many exercises, and how are they rated?	44 exercises, rated 10 to HM43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li><li>1.2.10 Analysis of an Algorithm</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: how should you work through it?	Implement straight insertion and Shellsort with a few increment sequences. Count comparisons and moves on random data and compare with Knuth's formulas and tables.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.2 Sorting by Exchanging: what does it cover?	Bubble sort and its analysis, Batcher's parallel merge exchange, quicksort with careful analysis of its average case, and radix exchange sort, which partitions on bits.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: why does it matter?	Quicksort is the most used sorting algorithm in the world. Knuth's analysis shows exactly why choosing the pivot and handling small subarrays matter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: what traps should you watch for?	<ul><li>Quadratic behavior on sorted input with a naive pivot.</li><li>Partitioning bugs with equal keys, the most common real-world quicksort failure.</li><li>Unbounded recursion depth: recurse on the smaller side first.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 3 (rated 10): what is it asking?	Is bubble sort stable? Quick check of the definition.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 33 (rated 15, recommended): what is it asking?	Move all negative numbers ahead of the others with the fewest swaps. Partitioning in its simplest form.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 18 (rated 20, recommended): what is it asking?	What quicksort does when every key is equal, and what breaks if you loosen the comparisons. The bug that bites real implementations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 31 (rated 20, recommended): what is it asking?	Turn quicksort into a selection algorithm for the m-th smallest. This is quickselect.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 55 (rated 22, recommended): what is it asking?	Add median-of-three pivot choice to the MIX quicksort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 26 (rated M24, recommended): what is it asking?	Build an input that makes the MIX quicksort run as slowly as possible. Teaches what the worst case really looks like.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 41 (rated 30, recommended): what is it asking?	Three-way partitioning into less, equal and greater blocks. The fix for inputs with many duplicate keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 38 (rated M30, recommended): what is it asking?	Average-case quantities for radix exchange on a second input model. The stretch, and it needs exercise 36.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: how many exercises, and how are they rated?	56 exercises, rated 10 to M48.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: what should you be comfortable with first?	<ul><li>5.2.1 Sorting by Insertion</li><li>1.2.7 Harmonic Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: how should you work through it?	Implement quicksort carefully with Knuth's partitioning scheme, a cutoff to insertion sort, and median-of-three. Test on sorted input, reverse-sorted input and all-equal keys. Read the bubble sort analysis for technique; bubble sort itself is not worth using.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.3 Sorting by Selection: what does it cover?	Straight selection, tree selection (tournaments), and heapsort with the heap data structure, plus analysis and the use of heaps as priority queues.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: why does it matter?	Heaps are the standard priority queue, used in Dijkstra, schedulers and top-k queries. Heapsort is the in-place O(n log n) worst-case fallback in introsort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, fill in the blank:<br>Heapsort is the in-place <span class="cg-blank">&nbsp;</span> worst-case fallback in introsort.	Heapsort is the in-place <b>O(n log n)</b> worst-case fallback in introsort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: what traps should you watch for?	<ul><li>Off-by-one in parent and child index formulas, especially 0-based versus Knuth's 1-based arrays.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 1 (rated 10): what is it asking?	Is straight selection stable? Think about what a long-distance swap does to equal keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 16 (rated 20): what is it asking?	Insert a key into a heap: the sift-up half of every priority queue.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 22 (rated 20, recommended): what is it asking?	Work backward to find which inputs heapify into a given heap. Tests that you really understand sift-down.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 18 (rated 21, recommended): what is it asking?	Floyd's improvement: sift the hole to the bottom first, then back up. Nearly halves the comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 8 (rated 24, recommended): what is it asking?	Make straight selection remember what it learned on the previous scan, and write it in MIX.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 15 (rated M22, recommended): what is it asking?	Generate primes with a priority queue instead of division. A surprising use of heaps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 33 (rated 21): what is it asking?	Merge two leftist-tree priority queues. A mergeable heap in a few lines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 4 (rated M25, recommended): what is it asking?	Is testing for a no-op swap worth it in straight selection? Average-case analysis with a practical answer.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: how many exercises, and how are they rated?	38 exercises, rated 10 to M41.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: what should you be comfortable with first?	<ul><li>5.2.2 Sorting by Exchanging</li><li>2.3 Trees</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: how should you work through it?	Implement heapsort from scratch with an array-based heap. Then implement a priority queue with insert and delete-min and use it for something real like merging k sorted files.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.4 Sorting by Merging: what does it cover?	Merging two sorted lists, two-way merge sort on arrays (natural and straight versions), and list merge sort that works on linked records without moving data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: why does it matter?	Merge sort is stable and the basis for Timsort (Python, Java objects) and for external sorting. List merge sort is the right way to sort linked lists.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: what traps should you watch for?	<ul><li>Knuth's array merge sorts are bottom-up and alternate between two memory areas; losing track of which area holds the current runs is the usual bug.</li><li>Breaking stability by taking from the right run on ties.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 1 (rated 21): what is it asking?	Generalize two-way merging to k-way. The building block of external sorting later in the chapter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 3 (rated 20, recommended): what is it asking?	Merge an update file into a master file, letting new records replace old ones. Classic batch-processing pattern.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 5 (rated 21, recommended): what is it asking?	Show that two pointers in the natural merge can never meet in certain steps, so a test can be dropped.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 11 (rated 21): what is it asking?	Is list merge sort stable? Check the tie-breaking rule.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 12 (rated 22, recommended): what is it asking?	Make list merge sort exploit runs already in the input, so sorted input finishes in one pass.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 21 (rated 23): what is it asking?	Count inversions as a side effect of list merge sort. The standard interview problem, from the source.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 13 (rated M34, recommended): what is it asking?	Average-case analysis of the list merge sort program. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: how many exercises, and how are they rated?	23 exercises, rated 16 to 47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: what should you be comfortable with first?	<ul><li>5.2.1 to 5.2.3</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: how should you work through it?	Implement top-down and bottom-up merge sort on arrays and list merge sort on a linked list. Check stability with records that have equal keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.5 Sorting by Distribution: what does it cover?	Radix sorting: distributing records into piles by digit, least significant digit first, using linked lists to avoid moving data, with analysis of when it beats comparison sorts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: why does it matter?	Radix sort is how you sort integers, strings and fixed-size keys fast. It shows up in GPU sorting and database engines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: what traps should you watch for?	<ul><li>Non-stable distribution passes break LSD radix sort.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 2 (rated 13): what is it asking?	Is radix sort stable? It has to be, and the reason is the whole trick.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 1 (rated 20, recommended): what is it asking?	Would in-place distribution counting beat the linked radix sort? Compare the costs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 8 (rated 20, recommended): what is it asking?	Adapt radix sorting to two's complement and ones' complement keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 14 (rated 22): what is it asking?	A card-dealing puzzle: sort a hand with two piles in two passes. Radix sort in disguise.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 4 (rated 23, recommended): what is it asking?	Link the piles as stacks instead of queues and find an order that still sorts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 16 (rated 25, recommended): what is it asking?	Sort strings of mixed lengths in time linear in their total length. The basis of practical string sorting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 6 (rated M24): what is it asking?	Expected number of empty piles after one distribution pass. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: how many exercises, and how are they rated?	18 exercises, rated 13 to 40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: what should you be comfortable with first?	<ul><li>5.2.4 Sorting by Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: how should you work through it?	Implement LSD radix sort on 32-bit integers with byte-sized digits and counting sort per pass. Benchmark it against your quicksort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.3.1 Minimum-Comparison Sorting: what does it cover?	How few comparisons can sort n items? The information-theoretic lower bound of about lg n!, and merge insertion (Ford-Johnson), which comes remarkably close for small n.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: why does it matter?	The lower bound is the reason no comparison sort beats O(n log n). This section also teaches how to think about decision trees, a general lower-bound tool.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, fill in the blank:<br>The lower bound is the reason no comparison sort beats <span class="cg-blank">&nbsp;</span>.	The lower bound is the reason no comparison sort beats <b>O(n log n)</b>.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: what traps should you watch for?	<ul><li>Confusing worst-case comparisons with average-case.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 23 (rated 10): what is it asking?	Why does an average-linear sort not beat the n lg n lower bound? Find the hidden assumption.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 5 (rated 16): what is it asking?	Draw a ternary comparison tree when keys can be equal.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 1 (rated 20): what is it asking?	Comparison trees for binary insertion and merging on four elements, with their path lengths.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 27 (rated 20, recommended): what is it asking?	Find the comparison tree that is fastest on average for a skewed input distribution.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 6 (rated M22, recommended): what is it asking?	Show that allowing three-way comparisons does not reduce the comparisons needed to sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 10 (rated M25, recommended): what is it asking?	Minimum average comparisons when every key is 0 or 1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 12 (rated M25, recommended): what is it asking?	Sorting with ties where you only need some valid order: what counts as sorting strongly.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 20 (rated M26, recommended): what is it asking?	Prove that minimum external path length means leaves sit on at most two levels. The stretch, and used again in 6.2.1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: how many exercises, and how are they rated?	36 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: what should you be comfortable with first?	<ul><li>1.2.5 Factorials</li><li>5.2 Internal Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: how should you work through it?	Draw the decision tree for sorting 3 elements. Try to find a 7-comparison sort for 5 elements on your own before reading how. Read merge insertion with pencil.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.2 Minimum-Comparison Merging: what does it cover?	The fewest comparisons needed to merge two sorted lists of given sizes, with adversary arguments and a binary merging algorithm for unequal sizes (Hwang-Lin).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: why does it matter?	Merging very unequal lists efficiently is useful for set intersection in search engines and databases. Adversary arguments are a powerful proof tool.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 15 (rated 12): what is it asking?	Compute a floor of a log ratio without division. A small practical trick used by binary merging.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 1 (rated 15): what is it asking?	Relate the merging function to the sorting function from 5.3.1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 2 (rated 22, recommended): what is it asking?	Show every binary tree with n + 1 leaves is a merging algorithm for one element.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 8 (rated 24, recommended): what is it asking?	Merge two elements into eight with only six comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 19 (rated 23, recommended): what is it asking?	Prove a recurrence inequality for the merging function.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 25 (rated 25, recommended): what is it asking?	Searching a sorted matrix is exactly as hard as merging. A neat equivalence with interview flavor.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 3 (rated M24): what is it asking?	Prove the adversary lower bound is exact when one list has a single element. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: how many exercises, and how are they rated?	25 exercises, rated 12 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: how should you work through it?	Focus on the adversary argument idea and on the binary merge algorithm. Implement binary merging and compare against linear merge when one list is tiny.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.3 Minimum-Comparison Selection: what does it cover?	Finding the k-th smallest element with as few comparisons as possible, including finding the second largest and the linear-time worst-case selection result.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: why does it matter?	Selection (median, percentiles, top-k) is a common real need. The linear-time median-of-medians idea is a classic.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: what traps should you watch for?	<ul><li>Median of medians is linear but has a big constant; quickselect usually wins in practice.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 5 (rated 10): what is it asking?	A one-line bound comparing two selection measures.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 1 (rated 15): what is it asking?	Why a player who won a round still got knocked out of Lewis Carroll's tournament. Sets up the second-largest problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 9 (rated 20, recommended): what is it asking?	Draw a comparison tree that finds the median of five in six comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 14 (rated 20, recommended): what is it asking?	Find the top two of five elements, unordered, with five comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 16 (rated 25, recommended): what is it asking?	Find both maximum and minimum with about 3n/2 comparisons, and prove you cannot do better.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 2 (rated M25, recommended): what is it asking?	Show that finding the t-th largest also tells you which elements are above and below it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 6 (rated M26, recommended): what is it asking?	Floyd's analysis of the second-largest problem with partial information.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 13 (rated HM28, recommended): what is it asking?	Find a median with about 1.5n comparisons on average by sampling first. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: how many exercises, and how are they rated?	27 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: how should you work through it?	Work out why finding the second largest takes about n + lg n comparisons using a tournament. Implement quickselect and median of medians and compare their speed.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.4 Networks for Sorting: what does it cover?	Sorting networks: fixed sequences of compare-exchange operations that do not depend on the data. Knuth covers the zero-one principle, Batcher's networks, optimal small networks, and related merging and selection networks.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: why does it matter?	Sorting networks are used in GPUs, SIMD code and hardware because they are branch-free and parallel. The zero-one principle is a great proof trick.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, a common trap: “Verifying a network on random inputs only.” What's the catch?	Use the zero-one principle to test exhaustively.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 1 (rated 20): what is it asking?	Draw Batcher's odd-even merge network for 3 and 5 inputs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 15 (rated 20): what is it asking?	Find a nonstandard four-element sorting network with five comparators.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 28 (rated M20, recommended): what is it asking?	Write down what each line of a network computes as a formula of mins and maxes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 36 (rated 22, recommended): what is it asking?	Networks that compare only neighbors need about n^2/2 comparators. Bubble sort as a network.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 4 (rated M23, recommended): what is it asking?	Prove the minimum delay for sorting six elements.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 13 (rated 24, recommended): what is it asking?	Build a sorting network from perfect shuffles. The pattern behind several parallel machines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 42 (rated 25, recommended): what is it asking?	A lower bound on comparators that grows by about lg n per added element.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 14 (rated M27, recommended): what is it asking?	Alekseev's transformation of networks and what it preserves. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: how many exercises, and how are they rated?	68 exercises, rated M16 to 50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: how should you work through it?	Draw a few networks for 4 and 5 elements. Write a program that verifies a network by testing all 0-1 inputs. Implement Batcher's bitonic or odd-even merge network.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.4.1 Multiway Merging and Replacement Selection: what does it cover?	Merging many sorted runs at once using a tree of losers, and replacement selection, which produces initial sorted runs about twice the size of memory on random data (the snowplow argument).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: why does it matter?	This is still exactly how external sorts and database sort operators work when data does not fit in RAM. Probably the most practical section of 5.4.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: what traps should you watch for?	<ul><li>Forgetting to mark records that belong to the next run in replacement selection.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 13 (rated 13): what is it asking?	Why is the second run from replacement selection usually longer than the first?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 3 (rated 16): what is it asking?	Run four-way replacement selection by hand on a famous sentence.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 18 (rated 22, recommended): what is it asking?	What happens if you run replacement selection on its own output?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 9 (rated 23, recommended): what is it asking?	Make replacement selection produce some runs ascending and others descending, as later tape methods need.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 19 (rated HM22): what is it asking?	Use the snowplow argument to show the first run is about (e - 1) times memory.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 14 (rated HM25, recommended): what is it asking?	Estimate the length of the last two runs using the snowplow picture.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 21 (rated HM23, recommended): what is it asking?	Run lengths for natural selection with a small reservoir.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 27 (rated HM30, recommended): what is it asking?	Analyze a refinement of natural selection that keeps filling the queue. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: how many exercises, and how are they rated?	30 exercises, rated 00 to M46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: what should you be comfortable with first?	<ul><li>5.2.3 Sorting by Selection (heaps)</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: how should you work through it?	Implement replacement selection with a heap and measure run lengths on random data; you should see about 2P. Implement a k-way merge with a heap. Read the snowplow analogy carefully; it is a lovely argument.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.2 The Polyphase Merge: what does it cover?	A way to merge runs using a limited number of tapes without wasting passes, where the ideal initial run distribution follows generalized Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: what traps should you watch for?	<ul><li>Spending a lot of time on tape rewind details.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 1 (rated 16): what is it asking?	Find the order in which the early runs go to the tapes. Checks that you can follow Algorithm D.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 2 (rated 21, recommended): what is it asking?	True or false: all dummy runs are gone after two merge phases.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 3 (rated 22, recommended): what is it asking?	Prove an ordering invariant on the dummy-run counts and explain why the algorithm depends on it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 12 (rated M18, recommended): what is it asking?	Connect powers of a small matrix to the perfect polyphase distributions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 8 (rated M20): what is it asking?	Ordered sums of 1 to p are counted by generalized Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 13 (rated 22, recommended): what is it asking?	A parity property of perfect Fibonacci distributions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 10 (rated M27): what is it asking?	Every integer has a unique representation in generalized Fibonacci numbers. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 23 (rated 29, recommended): what is it asking?	Rework the tape-splitting recurrences with a different merge rule.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: how many exercises, and how are they rated?	31 exercises, rated 11 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li><li>1.2.8 Fibonacci Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: how should you work through it?	Simulate a 3-tape polyphase merge by hand to see the Fibonacci pattern. Skim the detailed tape-handling algorithms.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.3 The Cascade Merge: what does it cover?	Another tape-merge pattern that cascades merges of decreasing order, and how it compares to polyphase.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 1 (rated 10): what is it asking?	Use the table to decide whether cascade or tape-splitting polyphase wins.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 5 (rated 20, recommended): what is it asking?	Prove an identity for cascade numbers by counting runs output on each pass.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 6 (rated M20): what is it asking?	Find a matrix whose powers generate the six-tape cascade numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 2 (rated 22, recommended): what is it asking?	Compare three-tape cascade with three-tape polyphase.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 3 (rated 23): what is it asking?	Tabulate a full cascade sort of 100 runs on six tapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 10 (rated M28, recommended): what is it asking?	Express the cascade generating functions through a family of polynomials. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: how many exercises, and how are they rated?	13 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: what should you be comfortable with first?	<ul><li>5.4.2 The Polyphase Merge</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: how should you work through it?	Skim. Note how it compares to polyphase and move on.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.4 Reading Tape Backwards: what does it cover?	Merge patterns that avoid rewinding by reading tapes backward, which flips the order of runs and changes the bookkeeping.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 6 (rated 07): what is it asking?	Convert a merge pattern from tree form to vector form.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 1 (rated 17): what is it asking?	How to adapt end-of-run sentinels when reading tapes backward.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 3 (rated 20, recommended): what is it asking?	Show read-backward polyphase ends with an ascending run on the right tape.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 11 (rated 20, recommended): what is it asking?	True or false: backward-reading merges must alternate ascending and descending runs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 19 (rated 22, recommended): what is it asking?	Find a binary tree that is not 3-fifo. Gets you into Karp's model.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 20 (rated 22, recommended): what is it asking?	State the strongly-fifo condition as a rule about tape labels.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 5 (rated 23, recommended): what is it asking?	Redo the polyphase merge-number formulas for reading backward.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 17 (rated 28, recommended): what is it asking?	Design an initial distribution for read-backward cascade that ends in ascending order. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: how many exercises, and how are they rated?	26 exercises, rated 07 to M46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: what should you be comfortable with first?	<ul><li>5.4.2 The Polyphase Merge</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: how should you work through it?	Skim for the idea. Use the spare time on 5.4.1 or on earlier Vol 3 exercises.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.5 The Oscillating Sort: what does it cover?	A tape sorting scheme that interleaves run creation and merging so the sort oscillates between phases, reducing tape movement.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 4 (rated 21): what is it asking?	Show one of two table updates in Algorithm B is never read.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 1 (rated 22): what is it asking?	Specify Sobel's original oscillating sort precisely for any number of tapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 5 (rated M25): what is it asking?	Which run counts let Algorithm B avoid rewinding? The math one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 3 (rated 29, recommended): what is it asking?	Chart Algorithm B on three tapes and nine runs, spot the inefficiency and fix it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: how many exercises, and how are they rated?	5 exercises, rated 21 to 29.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: what should you be comfortable with first?	<ul><li>5.4.4 Reading Tape Backwards</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: how should you work through it?	Skim.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.6 Practical Considerations for Tape Merging: what does it cover?	Real-world engineering of tape sorts: buffering, overlapping I/O with computation, block sizes and timing estimates.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: why does it matter?	The buffering and overlap ideas transfer directly to disk and network I/O. 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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 2 (rated 15): what is it asking?	Why one buffer in the timing diagram starts out empty.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 3 (rated 20): what is it asking?	Does forecasting still work with one fewer input buffer? Prove it or break it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 4 (rated 20): what is it asking?	Make Algorithm F work for a one-way merge.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 5 (rated 21, recommended): what is it asking?	Handle equal keys across files when forecasting, so buffers never run dry.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 9 (rated 22, recommended): what is it asking?	Estimate the gain from using the input tape as a work tape.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 10 (rated M23): what is it asking?	Show rewinds in six-tape polyphase or cascade rarely cover more than about half the file.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 7 (rated 26, recommended): what is it asking?	Fill out an imperfect run distribution with dummies in the best way. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: how many exercises, and how are they rated?	16 exercises, rated 13 to 41.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: what should you be comfortable with first?	<ul><li>1.4.4 Input and Output</li><li>5.4.1 Multiway Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: how should you work through it?	Read the buffering and overlap parts carefully, since they map to modern I/O. Skim device timing details.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.7 External Radix Sorting: what does it cover?	Doing radix sort on data that lives on external storage, distributing into files by digit.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: why does it matter?	Distribution-based external sorts are how many big-data systems partition data (think MapReduce shuffles).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 5 (rated 15): what is it asking?	Draw the merge tree that corresponds to Mauchly's backward radix sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 1 (rated 20): what is it asking?	Show balanced merging is a radix sort in a mixed-radix number system.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 6 (rated 20, recommended): what is it asking?	Run Mauchly's tape radix sort twice and predict the final order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 7 (rated 21): what is it asking?	Does the merge/radix duality carry over to multireel files?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 4 (rated M23): what is it asking?	Prove Ashenhurst's pattern is optimal for ten keys on four tapes. The math one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: how many exercises, and how are they rated?	7 exercises, rated 15 to M35.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: what should you be comfortable with first?	<ul><li>5.2.5 Sorting by Distribution</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: how should you work through it?	Skim and connect it to the shuffle phase of MapReduce or Spark.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.8 Two-Tape Sorting: what does it cover?	What you can do with only two tapes, and why it is so much harder than with three or more.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: why does it matter?	Mostly of theoretical and historical interest. 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.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 1 (rated 20): what is it asking?	Can two-tape bubble sorting gain from reading backward?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 10 (rated 20): what is it asking?	How would you sort several reels of data with just two tapes?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 4 (rated M23): what is it asking?	Build an elevator schedule when some floors need no stops.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 5 (rated M23, recommended): what is it asking?	True or false: a claim about passengers' destinations after the first step of the elevator algorithm.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 9 (rated M25, recommended): what is it asking?	Connect cocktail-shaker sort to the elevator problem's counts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 2 (rated M26): what is it asking?	Closed forms for the two-tape pass counts. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: how many exercises, and how are they rated?	10 exercises, rated 20 to M40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: how should you work through it?	Skim.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.9 Disks and Drums: what does it cover?	External sorting on random-access devices. Knuth shows how seek and latency costs turn the choice of merge pattern into an optimal-tree problem, how to size buffers, and how to spread files over several disks with striping, including randomized striping that keeps all disks busy during a merge.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: why does it matter?	Much more relevant than the tape sections: disk-based thinking (minimize seeks, read large sequential blocks) still matters for databases, even on SSDs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: what traps should you watch for?	<ul><li>Taking 1970s timing numbers literally.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 21 (rated M15, recommended): what is it asking?	How many blocks of a striped file land on each disk.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 23 (rated 20, recommended): what is it asking?	Buffer space needed for continuous two-way merging under two striping schemes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 19 (rated 25, recommended): what is it asking?	A keysorting scheme that sorts keys first and moves records later. Still how big sorts avoid moving data twice.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 20 (rated 25, recommended): what is it asking?	What virtual memory does and does not buy you for sorting. Ages well.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 4 (rated M21, recommended): what is it asking?	Buffer sizing when all input buffers are equal and only the output buffer varies.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 6 (rated 22, recommended): what is it asking?	Find an optimal merge tree for 23 runs; a short program helps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 7 (rated M24, recommended): what is it asking?	Optimal merge patterns when runs have different lengths.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 29 (rated M30, recommended): what is it asking?	Bound the average input time of randomized striping. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: how many exercises, and how are they rated?	31 exercises, rated M15 to 49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li><li>5.4.6 Practical Considerations</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: how should you work through it?	Read with modern storage in mind. Ask at each point: what changes for an SSD? What stays the same?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.5 Summary, History, and Bibliography: what does it cover?	Knuth's summary of chapter 5: a comparison of sorting methods with guidance on choosing one, plus the history of sorting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: why does it matter?	The comparison table and advice are practical gold, and the history is fun.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 1 (rated 05): what is it asking?	Sum up the chapter in one generalized theorem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 2 (rated 20): what is it asking?	Pick the best list-sorting method for six-digit keys from the summary table.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 4 (rated 28, recommended): what is it asking?	Which methods never make a comparison whose result they could already infer?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: how many exercises, and how are they rated?	5 exercises, rated 05 to 46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: what should you be comfortable with first?	<ul><li>Chapter 5</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: how should you work through it?	Read the comparison of methods closely and compare with what your language's standard sort actually does (introsort, Timsort, pdqsort).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §6.1 Sequential Searching: what does it cover?	Searching a list one item at a time, with tricks like sentinels to speed up the loop, and self-organizing lists that move frequently accessed items toward the front.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: why does it matter?	For small arrays, linear search beats fancier structures. The sentinel trick and move-to-front heuristic are still used in real code.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: what traps should you watch for?	<ul><li>Forgetting to restore the sentinel slot.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 2 (rated 15): what is it asking?	Restate sequential search for a linked list.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 4 (rated 17, recommended): what is it asking?	Does the sentinel trick work on a linked list?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 5 (rated 20): what is it asking?	When can the unrolled sentinel search be slower than the simple one?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 6 (rated 20, recommended): what is it asking?	Shave the inner loop further with three more MIX instructions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 22 (rated 20, recommended): what is it asking?	Find the 1000 nearest records in one scan: which data structure? A heap of the best so far.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 10 (rated M20): what is it asking?	The worst ordering of a table, and how it relates to the best.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 15 (rated M22, recommended): what is it asking?	Arrange a subroutine library on tape when several routines are needed at once.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 11 (rated M30): what is it asking?	Limiting behavior of the move-to-front list. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: how many exercises, and how are they rated?	22 exercises, rated 15 to M30.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: what should you be comfortable with first?	<ul><li>Chapter 5 basics</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: how should you work through it?	Implement linear search with and without a sentinel and benchmark. Implement move-to-front on a Zipf-distributed access pattern and measure the average search length.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.2.1 Searching an Ordered Table: what does it cover?	Binary search and its variants: uniform binary search, Fibonacci search, and interpolation search, with analysis and a careful look at how easy it is to get binary search wrong.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: why does it matter?	Binary search is famously hard to write correctly. Knowing the variants also helps with things like branch-free search and searching on sorted disk pages.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: what traps should you watch for?	<ul><li>Off-by-one in bounds and infinite loops when lo and hi are adjacent.</li><li>Midpoint overflow on very large arrays.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 3 (rated 15): what is it asking?	Identify the search method behind a given tree and compute its average costs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 1 (rated 21, recommended): what is it asking?	Prove what the bounds mean when binary search fails. This is the loop invariant.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 2 (rated 22, recommended): what is it asking?	Do two tempting shortcuts in the bound updates still work?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 24 (rated 23, recommended): what is it asking?	Binary search on the heap-ordered layout, using doubling instead of halving. Cache-friendly search.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 29 (rated 22, recommended): what is it asking?	Search keys that are only sorted up to a fixed involution.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 7 (rated M22, recommended): what is it asking?	Do small changes to the start of uniform binary search break it?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 23 (rated 25, recommended): what is it asking?	Bottenbruch's variant that tests for equality only at the end. The form most libraries use.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 25 (rated M25, recommended): what is it asking?	Relate internal and external node counts per level by generating functions. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: how many exercises, and how are they rated?	30 exercises, rated 15 to M42.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: what should you be comfortable with first?	<ul><li>6.1 Sequential Searching</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: how should you work through it?	Write binary search from memory, then test it exhaustively on all arrays up to size 10 and all targets. Implement interpolation search and test it on uniform and skewed data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.2 Binary Tree Searching: what does it cover?	Binary search trees: insertion, deletion, the average cost of random BSTs, and optimal BSTs built with dynamic programming when access frequencies are known.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: why does it matter?	BSTs are the basis of ordered maps. The optimal BST algorithm is a classic dynamic programming example.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: what traps should you watch for?	<ul><li>Deletion of a node with two children is the classic bug spot.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 1 (rated 15): what is it asking?	Make tree insertion handle the empty tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 3 (rated 20, recommended): what is it asking?	Can a sentinel speed up tree search the way it sped up sequential search?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 10 (rated 22, recommended): what is it asking?	Keep a search tree efficient on nonrandom input by making it look random.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 14 (rated 22, recommended): what is it asking?	Show the extra deletion step never lengthens paths, and find a case where it helps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 16 (rated 25, recommended): what is it asking?	Is deletion commutative? Experiment first, then prove.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 13 (rated M23, recommended): what is it asking?	Does deleting the root keep a random tree random?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 23 (rated M23, recommended): what is it asking?	Find an optimum search tree for a skewed weight set without a computer.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 45 (rated 30, recommended): what is it asking?	Make the Garsia-Wachs algorithm run in n log n time. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: how many exercises, and how are they rated?	49 exercises, rated 15 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: what should you be comfortable with first?	<ul><li>2.3 Trees</li><li>6.2.1 Searching an Ordered Table</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: how should you work through it?	Implement BST insert, search and delete with tests. Then implement the optimal BST dynamic program and check it on a small set of words with frequencies.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.3 Balanced Trees: what does it cover?	AVL trees: keeping a BST balanced with rotations so height stays logarithmic, plus discussion of other balancing schemes and list operations on balanced trees.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: why does it matter?	Self-balancing trees power ordered maps in most standard libraries and many databases. Rotations are a core skill.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: what traps should you watch for?	<ul><li>Updating balance factors incorrectly after a double rotation.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 1 (rated 01): what is it asking?	Why a simpler-looking fix for the double-rotation case does not work.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 2 (rated 16): what is it asking?	Why the tree grew taller in a particular insertion case.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 16 (rated 20, recommended): what is it asking?	Delete two nodes from an AVL tree by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 17 (rated 21, recommended): what is it asking?	Concatenate two balanced trees by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 12 (rated 24, recommended): what is it asking?	Best and worst cost of one specific insertion in the MIX program.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 27 (rated M23, recommended): what is it asking?	Worst-case comparisons for searching a 2-3 tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 10 (rated 27, recommended): what is it asking?	The shape of an AVL tree is determined by its balance factors in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 3 (rated M25, recommended): what is it asking?	At most about 62 percent of AVL nodes can be unbalanced. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: how many exercises, and how are they rated?	33 exercises, rated 01 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: what should you be comfortable with first?	<ul><li>6.2.2 Binary Tree Searching</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: how should you work through it?	Implement AVL insertion with single and double rotations. Write a checker that verifies balance factors after every insert, and run it on a million random inserts. Deletion is a stretch goal.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.4 Multiway Trees: what does it cover?	B-trees and their variants: nodes with many keys sized to a disk page, insertion by splitting, and analysis of their height and space usage.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: why does it matter?	B-trees are the index structure inside nearly every database and filesystem (SQLite, Postgres, NTFS, APFS).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: what traps should you watch for?	<ul><li>Off-by-one on the minimum and maximum keys per node when splitting.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 1 (rated 10): what is it asking?	Insert a key into a B-tree of order 7 by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 2 (rated 15): what is it asking?	Same insertion with overflow and three-way splitting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 5 (rated 21, recommended): what is it asking?	Worst-case fill after a split with variable-length keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 9 (rated 22): what is it asking?	Use a B-tree to index a list by position instead of by key.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 3 (rated 23, recommended): what is it asking?	When do sequential inserts first push the leaves to level 4, under three splitting policies?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 6 (rated 23): what is it asking?	Design B-tree deletion. The algorithm the text leaves to you.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 10 (rated 35, recommended): what is it asking?	Concurrent access to a shared B-tree. An open-ended design question that leads to database locking.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: how many exercises, and how are they rated?	10 exercises, rated 10 to HM37.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: what should you be comfortable with first?	<ul><li>6.2.3 Balanced Trees</li><li>5.4.9 Disks and Drums</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: how should you work through it?	Implement an in-memory B-tree with insertion and search. Then read how SQLite lays out its B-tree pages to connect it to the real world.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.3 Digital Searching: what does it cover?	Searching by looking at keys digit by digit or bit by bit instead of comparing whole keys: tries, digital search trees, and Patricia, a compact trie for long keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: why does it matter?	Tries and radix trees power autocomplete, IP routing tables, and in-memory indexes in many databases.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: what traps should you watch for?	<ul><li>Memory blow-up from fixed-size child arrays in each trie node.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 1 (rated 00): what is it asking?	A one-word joke about trie terminology.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 6 (rated 15): what is it asking?	Build a digital search tree from 15 keys inserted in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 4 (rated 21, recommended): what is it asking?	Pack a sparse trie table by overlapping entries. The idea behind double-array tries.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 35 (rated M20, recommended): what is it asking?	Probability that Patricia builds a given small tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 14 (rated 25, recommended): what is it asking?	Find every occurrence of a key in the text after Patricia finds one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 7 (rated M26, recommended): what is it asking?	Which insertion order gives the worst digital search tree?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 44 (rated 30, recommended): what is it asking?	Explore ternary search tries. A practical structure for string keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 20 (rated M30, recommended): what is it asking?	Analyze tries that switch to sequential search for small subfiles. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: how many exercises, and how are they rated?	45 exercises, rated 00 to M43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: what should you be comfortable with first?	<ul><li>6.2 Searching by Comparison of Keys</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: how should you work through it?	Implement a simple trie for words, then a compressed radix tree. Compare memory and speed with a hash set on a dictionary file.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.4 Hashing (part 1): what does it cover?	Part 1 covers the first part of the section (pages 513 to 533): choosing hash functions (division, multiplicative and Fibonacci hashing, and the idea of universal families), collision resolution by chaining, including coalesced chaining in a single table, and open addressing with linear probing and double hashing, ending with Brent's variation.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): why does it matter?	Hash tables are the most used data structure in practice. Knowing why a bad hash function wrecks performance will save you in production.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): what traps should you watch for?	<ul><li>Using a power-of-two table size with a weak hash: only low bits get used.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 6 (rated 15): what is it asking?	Judge a shortcut at the start of the division hashing code.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 15 (rated 16): what is it asking?	Why open addressing should report overflow one slot early.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 12 (rated 21, recommended): what is it asking?	Tighten the chained hashing inner loop to one conditional jump.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 18 (rated 21, recommended): what is it asking?	Compare two ways of computing the double hashing step.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 13 (rated 24, recommended): what is it asking?	Store only part of each key in a chained table, since the bucket implies the rest.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 66 (rated 25, recommended): what is it asking?	Keep keys ordered within probe sequences so failed searches stop early.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 76 (rated M21, recommended): what is it asking?	Extend a universal hash family to variable-length keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 72 (rated M28, recommended): what is it asking?	Universal hashing: why a randomly chosen function from a good family keeps chains short. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): how many exercises, and how are they rated?	78 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): what should you be comfortable with first?	<ul><li>6.1 to 6.3</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): how should you work through it?	Implement multiplicative hashing and test it against keys with patterns (all multiples of 64, sequential IDs). Implement a chained hash table and measure chain lengths against the theoretical averages.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 Hashing (part 2): what does it cover?	Part 2 covers the rest of the section (pages 533 to 549): deleting from open-addressed tables without breaking later searches, the starred analysis of expected probe counts for chaining, linear probing and double hashing as the table fills, hashing on external storage with buckets, a comparison of all the methods, and history.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): why does it matter?	Open addressing with linear probing is what many modern high-performance hash tables use. Knuth's linear probing analysis is historically the start of the field of algorithm analysis.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), a common trap: “Deleting by just clearing a slot breaks later searches.” What's the catch?	Tombstones or Knuth's deletion algorithm fix this.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): what traps should you watch for?	<ul><li>Letting the load factor get close to 1 with linear probing.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 21 (rated 20, recommended): what is it asking?	After marking a record deleted, should the item count go down?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 65 (rated 20, recommended): what is it asking?	How to store variable-length keys in a hash table.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 42 (rated M20, recommended): what is it asking?	Probability that chained hashing finds a free slot immediately.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 29 (rated M21): what is it asking?	The parking problem: linear probing told as a story about cars.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 33 (rated M23, recommended): what is it asking?	Why the classic linear probing estimate is only an approximation.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 34 (rated M23, recommended): what is it asking?	List-length distribution and probe counts for separate chaining.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 23 (rated 33, recommended): what is it asking?	Design deletion for coalesced chaining, analogous to linear-probing deletion.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 37 (rated M29, recommended): what is it asking?	Variance of successful search cost under separate chaining. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): how many exercises, and how are they rated?	78 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): what should you be comfortable with first?	<ul><li>6.4 Hashing (part 1)</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): how should you work through it?	Compare this with your clox hash table from chapter 20: tombstones, load factor, linear probing. Measure probe counts at load factors 0.5, 0.75 and 0.9 and compare to Knuth's formulas.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.5 Retrieval on Secondary Keys: what does it cover?	Searching on attributes other than the primary key: inverted files, multi-attribute queries, range and partial-match queries, and superimposed coding (the idea behind Bloom filters).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: why does it matter?	Inverted indexes power every search engine, and Bloom filters are everywhere from databases to network caches.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: what traps should you watch for?	<ul><li>Picking the number of Bloom filter hash functions without doing the math.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 3 (rated 19): what is it asking?	Which queries produce particular false drops in the recipe example.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 9 (rated M20): what is it asking?	Verify a construction of Steiner triple systems.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 6 (rated M20, recommended): what is it asking?	Average locations per query for composed combinatorial hash functions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 16 (rated 25, recommended): what is it asking?	Build superimposed codes from a triple system so no codeword is covered by two others.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 14 (rated 28): what is it asking?	Deletion in quadtrees and k-d trees. A real design problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 1 (rated M27, recommended): what is it asking?	Construct permutations that put every small subset first somewhere.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 17 (rated M30, recommended): what is it asking?	Analyze a bit-interleaving scheme for partial-match buckets. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: how many exercises, and how are they rated?	20 exercises, rated 19 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: what should you be comfortable with first?	<ul><li>6.4 Hashing</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: how should you work through it?	Build a tiny inverted index for a folder of text files and answer AND queries. Implement a Bloom filter and measure its false positive rate.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP Vol 3 review: what does it cover?	A review week for Volume 3: sorting and searching.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: why does it matter?	This is the most directly practical volume. Consolidating it gives you a reference you will use for the rest of your career.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 20 of §5 (rated 25, recommended): what is it asking?	Find all pairs of words that differ in at most two bits. Sorting as a tool for a search problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 13 of §5.2 (rated 27, recommended): what is it asking?	Do distribution counting in place, with no second array of records.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 43 of §5.2.1 (rated 25, recommended): what is it asking?	Remove the bounds test from shellsort's inner loop without a sentinel.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 30 of §5.2.2 (rated 25, recommended): what is it asking?	Keep quicksort fast on multiword keys as the file nears sorted order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 56 of §5.3.4 (rated 25, recommended): what is it asking?	For any unsorted 0-1 vector, build a network that fails only on it. Why the zero-one test must be exhaustive.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 44 of §6.2.2 (rated 25, recommended): what is it asking?	Rebuild a binary tree from the depths of its leaves in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 21 of §6.2.3 (rated 30, recommended): what is it asking?	Build perfectly balanced trees online in linear time.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 78 of §6.4 (rated M26, recommended): what is it asking?	Prove a multiply-and-shift family is universal. The hash function many fast libraries use.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: how many exercises, and how are they rated?	964 exercises, rated 00 to M50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: what should you be comfortable with first?	<ul><li>All of Vol 3</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: how should you work through it?	Gather your implementations (quicksort, heapsort, merge sort, radix sort, BST, AVL, B-tree, hash tables) in one repo with a shared benchmark harness. Write a short decision guide: which sort or search structure when.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::Vol 3 review
