#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
#columns:Front	Back	Tags
TAOCP §7.2.1.6 Generating All Trees: what does it cover?	Generating all trees: nested parentheses (Algorithm P), binary trees in linked form (Algorithm B), forests and their encodings, the Christmas tree pattern for subsets, oriented trees by parent pointers, and spanning trees of a graph (Algorithm S), including series-parallel graphs and a count of spanning trees via a determinant.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::about
TAOCP §7.2.1.6: why does it matter?	Generating all trees is useful for testing tree code exhaustively (a great way to find bugs in an AVL or parser). The Catalan connections tie back to 2.3.4.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::why
TAOCP §7.2.1.6: what is Algorithm P about?	Nested parentheses.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm
TAOCP §7.2.1.6: what is Algorithm B about?	Binary trees in linked form.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm
TAOCP §7.2.1.6: what is Algorithm S about?	Spanning trees of a graph.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm
TAOCP §7.2.1.6, exercise 3 (rated 23, recommended): what is it asking?	Prove a short conversion from a tree encoding to its inversion table.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 6 (rated 20, recommended): what is it asking?	Find which perfect matching corresponds to a given parenthesis string.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 23 (rated 25, recommended): what is it asking?	Work out the last tree visited by two of the generators.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 31 (rated M28, recommended): what is it asking?	Count degenerate binary trees and see how the encodings treat them.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 61 (rated M26, recommended): what is it asking?	Prove Raney's cycle lemma, the cleanest route to Catalan-style counts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 70 (rated 20, recommended): what is it asking?	Find a simple mate rule for bit strings that underlies the Christmas tree pattern.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 96 (rated 28, recommended): what is it asking?	Estimate how fast the spanning tree generator runs on paths and cycles.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6, exercise 27 (rated M33, recommended): what is it asking?	Study the Tamari lattice of binary trees. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise
TAOCP §7.2.1.6: how many exercises, and how are they rated?	124 exercises, rated 05 to HM46.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercises
TAOCP §7.2.1.6: what should you be comfortable with first?	<ul><li>2.3.4 Mathematical properties of trees</li><li>7.2.1.5</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::prereqs
TAOCP §7.2.1.6: how should you work through it?	Implement nested parentheses generation and convert each string to a binary tree. Use it to exhaustively test one of your tree implementations from Vol 3.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::approach
