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


GNU libavl 2.0.1

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

16. Red-Black Trees with Parent Pointers

As our twelfth and final example of a table data structure, this chapter will implement a table as a red-black tree with parent pointers, or "PRB" tree for short. We use prb_ as the prefix for identifiers. Here's the outline:

 
&#60;@xref{\NODE\, , License.&#62;,1}
#ifndef PRB_H
#define @cindex PRB_H macro
PRB_H 1
#include &#60;stddef.h&#62;
&#60;@xref{\NODE\, , Table types; tbl =>.&#62; prb,14}
&#60;@xref{\NODE\, , RB maximum height; rb =>.&#62; prb,195}
&#60;@xref{\NODE\, , TBST table structure; tbst =>.&#62; prb,250}
&#60;@xref{\NODE\, , PRB node structure.&#62;,553}
&#60;@xref{\NODE\, , TBST traverser structure; tbst =>.&#62; prb,267}
&#60;@xref{\NODE\, , Table function prototypes; tbl =>.&#62; prb,15}
#endif /* prb.h */

 
&#60;@xref{\NODE\, , License.&#62;,1}
#include &#60;assert.h&#62;
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
#include "prb.h"
&#60;@xref{\NODE\, , PRB functions.&#62;,554}

16.1 Data Types  
16.2 Operations  
16.3 Insertion  
16.4 Deletion  
16.5 Testing  


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