Next: rbtree_insert_dnode, Previous: rbtree_detach_node, Up: Public Routines
Create and insert a node into a red-black tree.
#include <rbtree/rbtree.h>int rbtree_insert( RBTree rbtree, void *data );
RBTree rbtree
- a handle to the tree into which to insert the node
void *data
- a pointer to the data
rbtree_insert
creates a node, sets its data pointer to the
specified pointer, and inserts it into the specified tree.
It returns `0' if the insert was successful, `1' if it was unable to create the new node.