home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "avl.h"
-
- HEADER *find(root, key, cmp)
- HEADER *root;
- HEADER *key;
- int (*cmp)();
- {
- static int relation;
-
- if( !root )
- return NULL;
-
- relation = (*cmp) (key, root+1);
-
- return(relation == 0) ? root + 1 :
- find( relation < 0 ? root->left : root->right, key, cmp );
- }