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


GNU libavl 2.0.1

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

12.4 Insertion

Insertion into an RTAVL tree follows the same pattern as insertion into other kinds of balanced tree. The outline is straightforward:

 
void **
rtavl_probe (struct rtavl_table *tree, void *item)
{ &#60;@xref{\NODE\, , avl_probe.&#62;() local variables; avl => rtavl,147} assert (tree != NULL && item != NULL); &#60;@xref{\NODE\, , Step 1: Search RTAVL tree for insertion point.&#62;,420} &#60;@xref{\NODE\, , Step 2: Insert RTAVL node.&#62;,421} &#60;@xref{\NODE\, , Step 3: Update balance factors after AVL insertion; avl =>.&#62; rtavl,150} &#60;@xref{\NODE\, , Step 4: Rebalance after RTAVL insertion.&#62;,422} }
This code is included in @refalso{418

12.4.1 Steps 1--2: Search and Insert  
12.4.2 Step 4: Rebalance  


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