Next: rbtree_detach_node, Previous: rbtree_destroy_dnode, Up: Public Routines
Remove a node from a binary tree and destroy it.
#include <rbtree/rbtree.h>void *rbtree_destroy_node( RBTree rbtree, RBNode rbnode );
RBTree rbtree
- the tree from which to remove the node
RBNode rbnode
- the node to remove
This routine removes the passed node from the specified tree and deallocates the memory associated with it. The user must destroy the data referenced by the node's data pointer.
Returns the node's data pointer if the node is not NULL
or
NIL(tree)
, NULL
otherwise.