summaryrefslogtreecommitdiff
path: root/lib/tree.h
blob: dc22c2dfdf5f2f0f7bd7c325ed25ee8ccc64eb1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);