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


GNU libavl 2.0.1

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

15.5.4 Symmetric Case

 
dir = q-&#62;pavl_link[0] != y;
y-&#62;pavl_balance--;
if (y-&#62;pavl_balance == -1)
  break;
else if (y-&#62;pavl_balance == -2) 
{ struct pavl_node *x = y-&#62;pavl_link[0]; if (x-&#62;pavl_balance == +1) {
&#60;@xref{\NODE\, , Right-side rebalancing case 1 in PAVL deletion.&#62;,544}
} else
{
&#60;@xref{\NODE\, , Right-side rebalancing case 2 in PAVL deletion.&#62;,545}
} }
This code is included in @refalso{539

 
struct pavl_node *w;
&#60;@xref{\NODE\, , Rebalance for +.&#62; balance factor in PAVL insertion in left subtree,530}
q-&#62;pavl_link[dir] = w;
This code is included in @refalso{543

 
y-&#62;pavl_link[0] = x-&#62;pavl_link[1];
x-&#62;pavl_link[1] = y;
x-&#62;pavl_parent = y-&#62;pavl_parent;
y-&#62;pavl_parent = x;
if (y-&#62;pavl_link[0] != NULL)
  y-&#62;pavl_link[0]-&#62;pavl_parent = y;
q-&#62;pavl_link[dir] = x;
if (x-&#62;pavl_balance == 0) 
{ x-&#62;pavl_balance = +1; y-&#62;pavl_balance = -1; break; }
else
{ x-&#62;pavl_balance = y-&#62;pavl_balance = 0; y = x; }
This code is included in @refalso{543


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