Next: rbtree_max, Previous: rbtree_insert_dnode, Up: Public Routines
Join two red-black trees.
#include <rbtree/rbtree.h>void rbtree_join( RBTree tree1, RBTree tree2 );
RBTree tree1
- the tree to merge the second into
RBTree tree2
- the tree to merge into the first tree
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
.