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


GNU libavl 2.0.1

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

10.4.1 Step 1: Search

There's nothing new or interesting in the search code.

 
if (tree-&#62;trb_root == NULL)
  return NULL;
p = (struct trb_node *) &tree-&#62;trb_root;
for (cmp = -1; cmp != 0; 
cmp = tree-&#62;trb_compare (item, p-&#62;trb_data, tree-&#62;trb_param))
{ dir = cmp > 0; pa[k] = p; da[k++] = dir; if (p-&#62;trb_tag[dir] == TRB_THREAD) return NULL; p = p-&#62;trb_link[dir]; } item = p-&#62;trb_data;
This code is included in @refalso{349


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