| www.delorie.com/gnu/docs/avl/libavl_252.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The actual deletion step is derived from that for PBSTs. We add code to modify balance factors and set up for rebalancing. After the deletion, q is the node at which balance factors must be updated and possible rebalancing occurs and dir is the side of q from which the node was deleted. This follows the pattern already seen in TAVL deletion (see section 9.5.2 Step 2: Delete).
if (p->pavl_link[1] == NULL)
{ |
No changes are needed for case 1. No balance factors need change and q and dir are already set up correctly.
<@xref{\NODE\, , Case 1 in PBST deletion; pbst =>.> pavl,497}
|
See the commentary on <@xref{\NODE\, , Case 3 in TAVL deletion.>,316} for details.
<@xref{\NODE\, , Case 2 in PBST deletion; pbst =>.> pavl,498}
r->pavl_balance = p->pavl_balance;
q = r;
dir = 1;
|
See the commentary on <@xref{\NODE\, , Case 4 in TAVL deletion.>,317} for details.
<@xref{\NODE\, , Case 3 in PBST deletion; pbst =>.> pavl,499}
s->pavl_balance = p->pavl_balance;
q = r;
dir = 0;
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |