Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
4 . 6 C l o s i n g G a p s i n t h e Tr e e 71 This leads to cases: 1. 2. A leaf node has no subordinates to promote, so the node becomes vacant. If there are subordinates, then we have two steps: a. promote a subordinate b. vacate the subordinate's current position 4.5.3 Pruning a Set of Nodes from a Tree An interesting version of this problem is displaying the tree with some of the subtrees pruned from the tree. This is usually a dynamic process used for displaying the tree structure in the front end. The most common example is clicking on the "+" and "-" boxes of a Windows directory display to open and close nested files. First, build a table for the root nodes of the subtrees you wish to hide: CREATE TABLE Cuts (node CHAR(5) NOT NULL PRIMARY KEY);