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


GNU libavl 2.0.1

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

15.4.4 Symmetric Case

 
struct pavl_node *x = y-&#62;pavl_link[1];
if (x-&#62;pavl_balance == +1)
  { 
&#60;@xref{\NODE\, , Rebalance for +.&#62; balance factor in PAVL insertion in right subtree,532}
} else
{
&#60;@xref{\NODE\, , Rebalance for -.&#62; balance factor in PAVL insertion in right subtree,533}
}
This code is included in @refalso{527

 
&#60;@xref{\NODE\, , Rotate left at y.&#62; in AVL tree; avl => pavl,158}
x-&#62;pavl_parent = y-&#62;pavl_parent;
y-&#62;pavl_parent = x;
if (y-&#62;pavl_link[1] != NULL)
  y-&#62;pavl_link[1]-&#62;pavl_parent = y;
This code is included in @refalso{531

 
&#60;@xref{\NODE\, , Rotate right at x.&#62; then left at y in AVL tree; avl => pavl,159}
w-&#62;pavl_parent = y-&#62;pavl_parent;
x-&#62;pavl_parent = y-&#62;pavl_parent = w;
if (x-&#62;pavl_link[0] != NULL)
  x-&#62;pavl_link[0]-&#62;pavl_parent = x;
if (y-&#62;pavl_link[1] != NULL)
  y-&#62;pavl_link[1]-&#62;pavl_parent = y;
This code is included in @refalso{531


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