mirror of
https://github.com/lxsang/ant-http
synced 2024-12-23 23:38:21 +01:00
19 lines
553 B
C
19 lines
553 B
C
|
#ifndef BST_H
|
||
|
#define BST_H 1
|
||
|
|
||
|
typedef struct _tree_node
|
||
|
{
|
||
|
int key;
|
||
|
void* data;
|
||
|
struct _tree_node* left;
|
||
|
struct _tree_node* right;
|
||
|
} bst_node_t;
|
||
|
|
||
|
void bst_free(bst_node_t* root);
|
||
|
bst_node_t* bst_insert(bst_node_t* root, int key, void* data);
|
||
|
bst_node_t* bst_find_min(bst_node_t* root);
|
||
|
bst_node_t* bst_find_max(bst_node_t* root);
|
||
|
bst_node_t* bst_find(bst_node_t* root, int x);
|
||
|
bst_node_t* bst_delete(bst_node_t* root, int x);
|
||
|
void bst_for_each(bst_node_t* root, void (*callback)(bst_node_t*, void **, int), void** args, int argc);
|
||
|
#endif
|