Go to the documentation of this file.
19 # include <sys/types.h>
83 void bst_put(
t_bst *bst,
const void *key,
const void *val);
void * bst_get(const t_bst *bst, const void *key)
Returns the value associated with a specified key.
void bst_delete(t_bst *bst)
Deletes this tree and free all its items and the associated data.
A node in a binary search tree.
size_t bst_size(const t_bst *bst)
Returns the number of elements in this tree.
void bst_put(t_bst *bst, const void *key, const void *val)
Adds a new item to the tree or overwrites an existing one.
const t_type * val_type
The type of values in the ree.
const t_type * key_type
The type of keys in the tree.
size_t size
The number of elements in this tree.
struct s_bst_node * right
The right child.
A full representation of a data type, used to achieve polymorphism in the implementation of data stru...
struct s_bst_node * left
The left child.
size_t bst_height(const t_bst *bst)
Returns the number of tiers in the tree.
t_bst * bst_new(const t_type *key_type, const t_type *val_type)
Initializes a new empty tree.
t_bst_node * root
The root of the tree.