Next: , Previous: uFree_post_order, Up: Private Routines


3.2.6 Free_post_order

Free a tree, in post-order sequence.

Synopsis

     #include <rbtree/rbtree.h>
     
     
     
static void Free_post_order( Tree *tree, void (*nfree)(void *), SiblingOrder sibling_order );

Parameters

Tree *tree
the tree to destroy
void (*nfree)(void *)
a routine to free the node data, may be RBTREE_NULL_DELETE
SiblingOrder sibling_order
the order in which to free the tree
          
          
Possible values for a SiblingOrder are as follows: LEFT_TO_RIGHT, RIGHT_TO_LEFT

Description

This routine traverses the given tree, freeing (post-order) as we go. It's the fastest deletion routine. Use it when it doesn't matter in what order the data are deleted.

The node data is passed to a user-supplied free routine, if available.