aboutsummaryrefslogtreecommitdiff
path: root/c13/ex01/btree_apply_prefix.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-24 08:02:55 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-24 08:02:55 +0200
commit5bab06313e71e9827baa426a02bbaf2a00b4e6a0 (patch)
tree5604e51c0008088f25b2f5dfb9143a852dd079dd /c13/ex01/btree_apply_prefix.c
parent23ad79e8b41c25bb4992d103d29a17612a52e351 (diff)
downloadpiscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.tar.gz
piscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.tar.bz2
piscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.zip
c12 passed, c13 start
Diffstat (limited to 'c13/ex01/btree_apply_prefix.c')
-rw-r--r--c13/ex01/btree_apply_prefix.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/c13/ex01/btree_apply_prefix.c b/c13/ex01/btree_apply_prefix.c
index e69de29..530d698 100644
--- a/c13/ex01/btree_apply_prefix.c
+++ b/c13/ex01/btree_apply_prefix.c
@@ -0,0 +1,22 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* btree_apply_infix.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/21 18:28:07 by cacharle #+# #+# */
+/* Updated: 2019/07/21 18:37:15 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "ft_btree.h"
+
+void btree_apply_prefix(t_btree *root, void (*applyf)(void *))
+{
+ if (root == NULL)
+ return ;
+ (*applyf)(root->item);
+ btree_apply_prefix(root->left);
+ btree_apply_prefix(root->right);
+}