-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtree.h
executable file
·51 lines (38 loc) · 1.73 KB
/
btree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* btree.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/03 21:41:19 by akharrou #+# #+# */
/* Updated: 2019/05/24 18:20:52 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef BTREE_H
# define BTREE_H
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
typedef struct s_btree_node
{
void *item;
struct s_btree_node *left;
struct s_btree_node *right;
} t_btree;
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
t_btree *btree_newnode(void *item);
void btree_apply_prefix(t_btree *root, void (*applyf)(void *));
void btree_apply_infix(t_btree *root, void (*applyf)(void *));
void btree_apply_suffix(t_btree *root, void (*applyf)(void *));
void btree_insert(t_btree **root, void *item,
int (*cmpf)(void *, void *));
void *btree_getitem(t_btree *root, void *item_ref,
int (*cmpf)(void *, void *));
int btree_level_count(t_btree *root);
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
#endif