| www.delorie.com/gnu/docs/avl/libavl_101.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Deletion in an AVL tree is remarkably similar to insertion. The steps that we go through are analogous:
The main difference is that, after a deletion, we may have to rebalance at more than one level of a tree, starting from the bottom up. This is a bit painful, because it means that we have to keep track of all the nodes that we visit as we search for the node to delete, so that we can then move back up the tree. The actual updating of balance factors and rebalancing steps are similar to those used for insertion.
The following sections cover deletion from an AVL tree in detail. Before we get started, here's an outline of the function.
See also: [ Knuth 1998b], pages 473--474; [ Pfaff 1998].
6.5.1 Step 1: Search 6.5.2 Step 2: Delete 6.5.3 Step 3: Update Balance Factors 6.5.4 Step 4: Rebalance 6.5.5 Step 5: Finish Up 6.5.6 Symmetric Case
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |