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