#ifndef _BSTREE_H_ #define _BSTREE_H_ /* Routines for binary search trees. Keys are strings, and ordering is done via strcmp. The tree will not hold duplicates. Thus, if you try to insert a duplicate key into the tree, it will replace the key and the value of the node with that key. That may not be what you want, but that's what it does. */ /* Create and destroy binary search trees */ extern void *new_bstree(); extern void free_bstree(void *tree); /* Insert and find. Bstree_find() returns NULL if it can't find the key. */ extern void bstree_insert(void *tree, char *key, void *value); extern void *bstree_find(void *tree, char *key); extern void *bstree_delete(void *tree, char *key); extern void *bstree_find_max(void *tree); extern void *bstree_find_min(void *tree); extern void *bstree_root(void *tree); extern void *bstree_left(void *node); extern void *bstree_right(void *node); extern char *bstree_key(void *node); extern void *bstree_value(void *node); #endif