#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
#columns:Front	Back	Tags
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
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
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
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
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
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
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
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
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
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
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
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
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
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
