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


GNU libavl 2.0.1

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

7.4.4 Symmetric Case

 
struct rb_node *y = pa[k - 2]-&#62;rb_link[0];
if (y != NULL && y-&#62;rb_color == RB_RED)
  { 
&#60;@xref{\NODE\, , Case 1 in right-side RB insertion rebalancing.&#62;,207}
} else
{ struct rb_node *x; if (da[k - 1] == 1) y = pa[k - 1]; else
{
&#60;@xref{\NODE\, , Case 3 in right-side RB insertion rebalancing.&#62;,209}
} &#60;@xref{\NODE\, , Case 2 in right-side RB insertion rebalancing.&#62;,208} break; }
This code is included in @refalso{201

 
&#60;@xref{\NODE\, , Case 1 in left-side RB insertion rebalancing.&#62;,203}
This code is included in @refalso{206

 
x = pa[k - 2];
x-&#62;rb_color = RB_RED;
y-&#62;rb_color = RB_BLACK;
x-&#62;rb_link[1] = y-&#62;rb_link[0];
y-&#62;rb_link[0] = x;
pa[k - 3]-&#62;rb_link[da[k - 3]] = y;
This code is included in @refalso{206

 
x = pa[k - 1];
y = x-&#62;rb_link[0];
x-&#62;rb_link[0] = y-&#62;rb_link[1];
y-&#62;rb_link[1] = x;
pa[k - 2]-&#62;rb_link[1] = y;
This code is included in @refalso{206


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