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


GNU libavl 2.0.1

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

14.5.2 Starting at the Last Node

This is the same as starting from the least item, except that we descend to the right.

 
void *
pbst_t_last (struct pbst_traverser *trav, struct pbst_table *tree)
{ assert (tree != NULL && trav != NULL); trav-&#62;pbst_table = tree; trav-&#62;pbst_node = tree-&#62;pbst_root; if (trav-&#62;pbst_node != NULL)
{ while (trav-&#62;pbst_node-&#62;pbst_link[1] != NULL) trav-&#62;pbst_node = trav-&#62;pbst_node-&#62;pbst_link[1]; return trav-&#62;pbst_node-&#62;pbst_data; } else
return NULL; }
This code is included in @refalso{502


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