| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sfltree.h" void *tree_next (void *tree)
Finds and returns the next node in a tree.
{ TREE *current, *child; if ((!tree) || (tree == TREE_NULL)) return NULL; current = tree; if (current-> right != TREE_NULL) return tree first (current-> right); else { current = tree; child = TREE_NULL; while ((current-> parent) && (current-> right == child)) { child = current; current = current-> parent; } if (current-> right != child) return current; else return NULL; } }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |