view src/bst.h @ 12:d359966ed8de

Added trie
author Eris Caffee <discordia@eldalin.com>
date Mon, 01 Oct 2012 15:50:30 -0500
parents 68f85ffc6029
children
line source
1 #ifndef BST_H_
2 #define BST_H_
4 #include <stddef.h>
5 #include <stdbool.h>
7 struct bst;
8 struct bst_iterator;
10 struct bst * bst_new(bool (*le)(void * a, void * b), bool (*eq)(void * a, void * b));
11 void bst_delete(struct bst * bst);
13 void * bst_insert (struct bst * bst, void * data);
14 void * bst_search (struct bst * bst, void * data);
15 void * bst_search_iterative (struct bst * bst, void * data);
16 void * bst_minimum (struct bst * bst);
17 void * bst_maximum (struct bst * bst);
18 unsigned int bst_size (struct bst * bst);
20 void bst_walk_inorder (struct bst * bst, void (*op)(void * data));
21 void bst_walk_preorder (struct bst * bst, void (*op)(void * data));
22 void bst_walk_postorder (struct bst * bst, void (*op)(void * data));
24 struct bst_iterator * bst_begin (struct bst * bst);
25 struct bst_iterator * bst_end (struct bst * bst);
26 struct bst_iterator * bst_next (struct bst_iterator * it);
27 struct bst_iterator * bst_prev (struct bst_iterator * it);
28 void * bst_value (struct bst_iterator * it);
29 void * bst_find (struct bst_iterator * it, void * data);
30 void * bst_remove (struct bst_iterator * it);
32 void bst_dump (struct bst * bst, void (*print_val)(void *) );
34 #endif