diff options
Diffstat (limited to 'lib/tree.h')
-rw-r--r-- | lib/tree.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/tree.h b/lib/tree.h new file mode 100644 index 0000000..dc22c2d --- /dev/null +++ b/lib/tree.h @@ -0,0 +1,22 @@ + +#pragma once + +#include <inttypes.h> +#include <stdlib.h> +#include <stdbool.h> + +#include "types.h" + +typedef struct node_t { + v_t value; + v_t level; + struct node_t *left; + struct node_t *right; +} node_t; + +void tree_insert(node_t **T, v_t x); + +bool tree_contains(node_t *T, v_t x); + +void tree_freeNode(node_t *T); + |