view src/ost.h @ 12:d359966ed8de

Added trie
author Eris Caffee <discordia@eldalin.com>
date Mon, 01 Oct 2012 15:50:30 -0500
parents
children
line source
1 #ifndef OST_H_
2 #define OST_H_
4 #include <stddef.h>
5 #include <stdbool.h>
7 struct ost;
8 struct ost_iterator;
10 struct ost * ost_new(bool (*le)(void * a, void * b), bool (*eq)(void * a, void * b));
11 void ost_delete(struct ost * ost);
13 void * ost_insert (struct ost * ost, void * data);
14 void * ost_search (struct ost * ost, void * data);
15 void * ost_search_iterative (struct ost * ost, void * data);
16 void * ost_minimum (struct ost * ost);
17 void * ost_maximum (struct ost * ost);
18 unsigned int ost_size (struct ost * ost);
20 void ost_walk_inorder (struct ost * ost, void (*op)(void * data));
21 void ost_walk_preorder (struct ost * ost, void (*op)(void * data));
22 void ost_walk_postorder (struct ost * ost, void (*op)(void * data));
24 struct ost_iterator * ost_begin (struct ost * ost);
25 struct ost_iterator * ost_end (struct ost * ost);
26 struct ost_iterator * ost_next (struct ost_iterator * it);
27 struct ost_iterator * ost_prev (struct ost_iterator * it);
28 void * ost_find (struct ost_iterator * it, void * data);
29 void * ost_remove (struct ost_iterator * it);
30 void * ost_value (struct ost_iterator * it);
32 unsigned int ost_black_depth(struct ost * ost);
33 void ost_dump(struct ost * ost, void (*print_val)(void *) );
35 struct ost_iterator * ost_select(struct ost * ost, unsigned int i);
36 struct ost_iterator * ost_select_subtree(struct ost_iterator * it, unsigned int i);
37 unsigned int ost_rank(struct ost_iterator * it);
40 #endif