/** * Prunes off the subtree starting at the supplied root. * * @param pruneRoot The root of the subtree to remove. */ public void pruneSubtree(DecisionTreeNode pruneRoot) { if (pruneRoot == null) { return; } // Detach the root node of the subtree. pruneRoot.detach(); // Once a node has been removed, the tree is no longer complete. Complete = false; // Now, tell the tree to remove all the // node's children. recursiveRemoveSubtree(pruneRoot); }
/** * Prunes off the subtree starting at the supplied root. * * @param pruneRoot The root of the subtree to remove. */ public void pruneSubtree(DecisionTreeNode pruneRoot) { if (pruneRoot == null) { return; } // Detach the root node of the subtree. pruneRoot.detach(); // Once a node has been removed, the tree is no longer complete. Complete = false; // Now, tell the tree to remove all the // node's children. recursiveRemoveSubtree(pruneRoot); }