aboutsummaryrefslogtreecommitdiff
path: root/c13/ex02
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-24 18:46:39 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-24 18:46:58 +0200
commit83edb77d74bb339f3e1324a51039c78ac503db90 (patch)
tree1e69b9330430438fa499f94e864dcfb4d83ea007 /c13/ex02
parent5bab06313e71e9827baa426a02bbaf2a00b4e6a0 (diff)
downloadpiscine-83edb77d74bb339f3e1324a51039c78ac503db90.tar.gz
piscine-83edb77d74bb339f3e1324a51039c78ac503db90.tar.bz2
piscine-83edb77d74bb339f3e1324a51039c78ac503db90.zip
bsq and c13 passed
Diffstat (limited to 'c13/ex02')
-rw-r--r--c13/ex02/btree_apply_infix.c9
-rw-r--r--c13/ex02/ft_btree.h8
2 files changed, 9 insertions, 8 deletions
diff --git a/c13/ex02/btree_apply_infix.c b/c13/ex02/btree_apply_infix.c
index 3ff3278..c05cbd6 100644
--- a/c13/ex02/btree_apply_infix.c
+++ b/c13/ex02/btree_apply_infix.c
@@ -6,17 +6,18 @@
/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/21 18:28:07 by cacharle #+# #+# */
-/* Updated: 2019/07/23 21:09:53 by cacharle ### ########.fr */
+/* Updated: 2019/07/24 13:49:17 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
+#include <stdlib.h>
#include "ft_btree.h"
-void btree_apply_infix(t_btree *root, void (*applyf)(void *))
+void btree_apply_infix(t_btree *root, void (*applyf)(void *))
{
if (root == NULL)
return ;
- btree_apply_infix(root->left);
+ btree_apply_infix(root->left, applyf);
(*applyf)(root->item);
- btree_apply_infix(root->right);
+ btree_apply_infix(root->right, applyf);
}
diff --git a/c13/ex02/ft_btree.h b/c13/ex02/ft_btree.h
index 3af177e..2a1506a 100644
--- a/c13/ex02/ft_btree.h
+++ b/c13/ex02/ft_btree.h
@@ -6,7 +6,7 @@
/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/17 19:29:12 by cacharle #+# #+# */
-/* Updated: 2019/07/21 18:19:33 by cacharle ### ########.fr */
+/* Updated: 2019/07/24 12:10:39 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,9 +15,9 @@
typedef struct s_btree
{
- struct s_btree *left;
- struct s_btree *right;
- void *item;
+ struct s_btree *left;
+ struct s_btree *right;
+ void *item;
} t_btree;
#endif