Next: rbtree_udelete, Previous: rbtree_count, Up: Public Routines
Delete a red-black binary tree
#include <rbtree/rbtree.h>void rbtree_delete( RBTree rbtree, void (*nfree)(void *), Visit visit, SiblingOrder sibling_order );
RBTree rbtree
- the handle of the rbtree to delete
void (*nfree)(void *)
- a routine which deallocates node user memory, may be
RBTREE_NULL_DELETE
Visit visit
- the order of deletion, either
IN_ORDER
, orPOST_ORDER
, (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 user node data. It is strongly suggested that the deallocation function be specified.