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


GNU libavl 2.0.1

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

13.4 Deletion

The process of deletion from an RTRB tree is the same that we've seen many times now. Code for the first step is borrowed from RTAVL deletion:

 
void *
rtrb_delete (struct rtrb_table *tree, const void *item)
{ struct rtrb_node *pa[RTRB_MAX_HEIGHT]; /* Nodes on stack. */ unsigned char da[RTRB_MAX_HEIGHT]; /* Directions moved from stack nodes. */ int k; /* Stack height. */ struct rtrb_node *p; assert (tree != NULL && item != NULL); &#60;@xref{\NODE\, , Step 1: Search RTAVL tree for item to delete; rtavl =>.&#62; rtrb,430} &#60;@xref{\NODE\, , Step 2: Delete RTRB node.&#62;,469} &#60;@xref{\NODE\, , Step 3: Rebalance after RTRB deletion.&#62;,474} &#60;@xref{\NODE\, , Step 4: Finish up after RTRB deletion.&#62;,481} }
This code is included in @refalso{455

13.4.1 Step 2: Delete  
13.4.2 Step 3: Rebalance  
13.4.3 Step 4: Finish Up  


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