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