|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sfltree.h" void *tree_find_eq (TREE **root, void *tree, TREE_COMPARE *comp)
Finds a node with data exactly matching that provided.
{
TREE
*current = *root,
*found;
found = NULL;
while (current != TREE_NULL)
switch ((comp) (current, tree))
{
case -1: current = current-> right; break;
case 1: current = current-> left; break;
default: found = current; /* In case of duplicates, */
current = current-> left; /* get the first one. */
}
return found;
}
| | << | < | > | >> |
|