Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
2.6 Deleting Nodes in the Adjacency List Model 29 I am leaving the node to the reader, but the general idea is to rearrange the tree structure so that the dummy employee number used earlier is finally moved to a leaf node where it is a degenerate case of removing a subtree. For example, we could remove "Chuck" and then promote "Donna" to his position. Her position is left vacant and can be removed, leaving "Eddie" as the senior subordinate. 2.6.3 Promoting an Entire Subtree after Deletion You cannot delete the root or the tree unravels into a forest of dis- joint subtrees. The constraints will prevent this from happening, but you can also test for the root in the insertion statement. Let's use the WorkingTable to hold intermediate traversal results again (Figure 2.2). CREATE PROCEDURE DeleteAndPromoteSubtree (IN dead_guy INTEGER) LANGUAGE SQL DETERMINISTIC SET CONSTRAINTS <<list of constraints>> DEFERRED;