| www.delorie.com/gnu/docs/avl/libavl_262.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Inserting into a red-black tree is a problem whose form of solution should by now be familiar to the reader. We must now update parent pointers, of course, but the major difference here is that it is fast and easy to find the parent of any given node, eliminating any need for a stack.
Here's the function outline. The code for finding the insertion point is taken directly from the PBST code:
See also: [ Cormen 1990], section 14.3.
16.3.1 Step 2: Insert 16.3.2 Step 3: Rebalance 16.3.3 Symmetric Case
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |