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


GNU libavl 2.0.1

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

11.6.4 Advancing to the Next Node

We use the same algorithm to advance an RTBST traverser as for TBST traversers. The only important difference between this code and &#60;@xref{\NODE\, , \TITLE\}.&#62;{TBST traverser advance function,275} is the substitution of rtbst_rtag for tbst_tag[1].

 
void *
rtbst_t_next (struct rtbst_traverser *trav)
{ assert (trav != NULL); if (trav-&#62;rtbst_node == NULL) return rtbst_t_first (trav, trav-&#62;rtbst_table); else if (trav-&#62;rtbst_node-&#62;rtbst_rtag == RTBST_THREAD)
{ trav-&#62;rtbst_node = trav-&#62;rtbst_node-&#62;rtbst_link[1]; return trav-&#62;rtbst_node != NULL ? trav-&#62;rtbst_node-&#62;rtbst_data : NULL; }
else
{ trav-&#62;rtbst_node = trav-&#62;rtbst_node-&#62;rtbst_link[1]; while (trav-&#62;rtbst_node-&#62;rtbst_link[0] != NULL) trav-&#62;rtbst_node = trav-&#62;rtbst_node-&#62;rtbst_link[0]; return trav-&#62;rtbst_node-&#62;rtbst_data; } }
This code is included in @refalso{395


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