#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
#columns:Front	Back	Tags
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
