feat: begin binary tree implementation
parent
379a05a7b6
commit
df50f96983
|
@ -0,0 +1,15 @@
|
|||
#ifndef VIETER_TREE
|
||||
#define VIETER_TREE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct vieter_tree vieter_tree;
|
||||
|
||||
typedef enum vieter_tree_error {
|
||||
vieter_tree_ok = 0,
|
||||
vieter_tree_already_present = 1
|
||||
} vieter_tree_error;
|
||||
|
||||
vieter_tree_error vieter_tree_insert(uint64_t key, void *data);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef VIETER_BALANCED_TREE_NODE
|
||||
#define VIETER_BALANCED_TREE_NODE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct vieter_tree_node {
|
||||
uint64_t key;
|
||||
void *data;
|
||||
struct vieter_tree_node *left;
|
||||
struct vieter_tree_node *right;
|
||||
} vieter_tree_node;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,6 @@
|
|||
#include "vieter_tree.h"
|
||||
#include "node.h"
|
||||
|
||||
struct vieter_tree {
|
||||
uint64_t size;
|
||||
};
|
Loading…
Reference in New Issue