Next: rbtree_destroy, Previous: rbtree_delete, Up: Public Routines
Delete a red-black binary tree.
#include <rbtree/rbtree.h>void rbtree_udelete( RBTree rbtree, void (*nfree)(void *,void *), void *udata, Visit visit, SiblingOrder sibling_order );
RBTree rbtree
- the handle of the rbtree to delete
void (*nfree)(void *,void *)
- a routine which deallocates node user memory, may be
RBTREE_NULL_DELETE
void *udata
- a pointer to data to be passed to the action routine
Visit visit
- the order of deletion. (
PRE_ORDER
is treated asPOST_ORDER
)Possible values for aVisit
are as follows:PRE_ORDER
,IN_ORDER
,POST_ORDER
SiblingOrder sibling_order
- the direction that the tree is parsed
Possible values for aSiblingOrder
are as follows:LEFT_TO_RIGHT
,RIGHT_TO_LEFT
This routine deletes a red-black binary tree, destroying all nodes
in the specified order and direction. It optionally takes a user
supplied function which, when passed a node's data pointer,
deallocates possible user node data. It is strongly suggested that
the deallocation function be specified. This routine differs from
rbtree_delete
in that it can pass along a pointer provided by
the calling routine to the deallocation function routine, allowing
arbitrary data to be available to it.