(
Latest Revision:
05/03/2005
)
- If you implement the TIP function by deleting nodes from a copy of the
tree, then beware of unintended interactions between your traversal of
the tree and your deletion algorithm. It is prudent to use a post-order
traversal order in the TIP function. Consider this tree:
MX
G T
D J QX W
Suppose that you need to delete both MX and QX to process the TIP properly.
If, for example, you traverse the tree in pre-order while doing the deletions,
deleting MX puts QX in the former position of MX. If your algorithm then just
continues on in preorder, it will never visit (or delete) QX.
-