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


GNU libavl 2.0.1

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

16.4.4 Symmetric Case

 
struct prb_node *w = f-&#62;prb_link[0];
if (w-&#62;prb_color == PRB_RED)
  { 
&#60;@xref{\NODE\, , Ensure w.&#62; is black in right-side PRB deletion rebalancing,579}
} if ((w-&#62;prb_link[0] == NULL
|| w-&#62;prb_link[0]-&#62;prb_color == PRB_BLACK) && (w-&#62;prb_link[1] == NULL
|| w-&#62;prb_link[1]-&#62;prb_color == PRB_BLACK)) {
&#60;@xref{\NODE\, , Case 1 in right-side PRB deletion rebalancing.&#62;,580}
} else
{ if (w-&#62;prb_link[0] == NULL
|| w-&#62;prb_link[0]-&#62;prb_color == PRB_BLACK) {
&#60;@xref{\NODE\, , Transform right-side PRB deletion rebalancing case 3 into case 2.&#62;,582}
} &#60;@xref{\NODE\, , Case 2 in right-side PRB deletion rebalancing.&#62;,581} break; }
This code is included in @refalso{571

 
w-&#62;prb_color = PRB_BLACK;
f-&#62;prb_color = PRB_RED;
f-&#62;prb_link[0] = w-&#62;prb_link[1];
w-&#62;prb_link[1] = f;
g-&#62;prb_link[g-&#62;prb_link[0] != f] = w;
w-&#62;prb_parent = f-&#62;prb_parent;
f-&#62;prb_parent = w;
g = w;
w = f-&#62;prb_link[0];
w-&#62;prb_parent = f;
This code is included in @refalso{578

 
w-&#62;prb_color = PRB_RED;
This code is included in @refalso{578

 
w-&#62;prb_color = f-&#62;prb_color;
f-&#62;prb_color = PRB_BLACK;
w-&#62;prb_link[0]-&#62;prb_color = PRB_BLACK;
f-&#62;prb_link[0] = w-&#62;prb_link[1];
w-&#62;prb_link[1] = f;
g-&#62;prb_link[g-&#62;prb_link[0] != f] = w;
w-&#62;prb_parent = f-&#62;prb_parent;
f-&#62;prb_parent = w;
if (f-&#62;prb_link[0] != NULL)
  f-&#62;prb_link[0]-&#62;prb_parent = f;
This code is included in @refalso{578

 
struct prb_node *y = w-&#62;prb_link[1];
y-&#62;prb_color = PRB_BLACK;
w-&#62;prb_color = PRB_RED;
w-&#62;prb_link[1] = y-&#62;prb_link[0];
y-&#62;prb_link[0] = w;
if (w-&#62;prb_link[1] != NULL)
  w-&#62;prb_link[1]-&#62;prb_parent = w;
w = f-&#62;prb_link[0] = y;
w-&#62;prb_link[0]-&#62;prb_parent = w;
This code is included in @refalso{578


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