Next: , Previous: rbtree_insert, Up: Public Routines


3.1.11 rbtree_insert_dnode

Insert a detached node into a tree.

Synopsis

     #include <rbtree/rbtree.h>
     
     
     
int rbtree_insert_dnode( RBTree rbtree, RBNode rbnode );

Parameters

RBTree rbtree
a handle to the tree into which to insert the node
RBNode rbnode
the node to insert

Description

This routine inserts a detached node into a binary tree. It assumes that the tree's insert/delete comparison function can be applied to the data in the passed node. The node handle must have been obtained from rbtree_detach_node.

Returns

It returns ‘1’ if the node is NULL or NIL(tree), ‘0’ otherwise.