Next: , Previous: Insert, Up: Private Routines


3.2.8 JoinTrees

Join two trees.

Synopsis

     #include <rbtree/rbtree.h>
     
     
     
static void JoinTrees( Tree *tree1, Tree *tree2 );

Parameters

Tree *tree1
the tree to merge the second into
Tree *tree2
the tree to merge into the first tree

Description

This routine joins two trees, detaching nodes from the second and inserting them in the first. As the second tree is completely gutted, the routine doesn't spend time keeping its redblack nature intact during the process.