42/d13/ex03/ft_btree.h
2016-11-20 02:20:23 +02:00

33 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_btree.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/11 11:52:39 by gtertysh #+# #+# */
/* Updated: 2016/11/11 22:27:02 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_BTREE_H
# define FT_BTREE_H
typedef struct s_btree
{
struct s_btree *left;
struct s_btree *right;
void *item;
} t_btree;
t_btree *btree_create_node(void *item);
void btree_print(t_btree *tree);
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_data(t_btree **root, void *item,
int (*cmpf)(void *, void *));
void *btree_search_item(t_btree *root, void *data_ref,
int (*cmpf)(void *, void *));
#endif