www.delorie.com/gnu/docs/avl/libavl_115.html   search  
 
Buy GNU books!


GNU libavl 2.0.1

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Operations

Now we'll implement for RB trees all the operations that we did for BSTs. Everything but the insertion and deletion function can be borrowed either from our BST or AVL tree functions. The copy function is an unusual case: we need it to copy colors, instead of balance factors, between nodes, so we replace avl_balance by rb_color in the macro expansion.

 
&#60;@xref{\NODE\, , BST creation function; bst =>.&#62; rb,30}
&#60;@xref{\NODE\, , BST search function; bst =>.&#62; rb,31}
&#60;@xref{\NODE\, , RB item insertion function.&#62;,197}
&#60;@xref{\NODE\, , Table insertion convenience functions; tbl =>.&#62; rb,592}
&#60;@xref{\NODE\, , RB item deletion function.&#62;,220}
&#60;@xref{\NODE\, , AVL traversal functions; avl =>.&#62; rb,178}
&#60;@xref{\NODE\, , AVL copy function; avl =>.&#62; rb; avl_balance => rb_color,185}
&#60;@xref{\NODE\, , BST destruction function; bst =>.&#62; rb,84}
&#60;@xref{\NODE\, , Default memory allocation functions; tbl =>.&#62; rb,6}
&#60;@xref{\NODE\, , Table assertion functions; tbl =>.&#62; rb,594}
This code is included in @refalso{193


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003