3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-24 06:10:12 +01:00
popnhax/util/bst.h

19 lines
395 B
C
Raw Normal View History

2024-05-20 21:54:49 +02:00
#ifndef __BST_H__
#define __BST_H__
2024-06-16 20:44:13 +02:00
#include <stdint.h>
2024-05-20 21:54:49 +02:00
typedef struct bst_s
{
uint32_t data;
2024-06-16 20:44:13 +02:00
void *extra_data;
2024-05-20 21:54:49 +02:00
struct bst_s *right;
struct bst_s *left;
} bst_t;
bst_t* bst_search(bst_t *root, uint32_t val);
bst_t* bst_insert(bst_t *root, uint32_t val);
2024-06-16 20:44:13 +02:00
bst_t* bst_insert_ex(bst_t *root, uint32_t val, void *extra_data, void*(*extra_data_cb)(void *arg1, void *arg2));
2024-05-20 21:54:49 +02:00
#endif