Next: , Previous: rbtree_destroy_dnode, Up: Public Routines


3.1.8 rbtree_destroy_node

Remove a node from a binary tree and destroy it.

Synopsis

     #include <rbtree/rbtree.h>
     
     
     
void *rbtree_destroy_node( RBTree rbtree, RBNode rbnode );

Parameters

RBTree rbtree
the tree from which to remove the node
RBNode rbnode
the node to remove

Description

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

Returns the node's data pointer if the node is not NULL or NIL(tree), NULL otherwise.