Next: , Previous: rbtree_insert_dnode, Up: Public Routines


3.1.12 rbtree_join

Join two red-black trees.

Synopsis

     #include <rbtree/rbtree.h>
     
     
     
void rbtree_join( RBTree tree1, RBTree tree2 );

Parameters

RBTree tree1
the tree to merge the second into
RBTree tree2
the tree to merge into the first tree

Description

This routine joins two redblack trees, moving nodes from the second tree to the first. It doesn't delete the second tree, just empties it. This routine is more efficient than calling rbtree_detach_node and rbtree_insert_dnode.