The algorithm used in the previous section is easy and fast, but it is
not the most common method for destroying a tree. The usual way is to
perform a traversal of the tree, in much the same way we did for tree
traversal and copying. Once again, we'll start from a recursive
implementation, because these are so easy to write. The only tricky
part is that subtrees have to be freed before the root. This
code is hard-wired to use free() for simplicity:
Please take a moment to fill out
this visitor survey You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)