Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
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:
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|