My Kernel v0.1.0
avl.h File Reference

AVL tree implementation. More...

#include <kernel/types.h>
#include <utils/compiler.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for avl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  avl
 A single node of an AVL tree. More...
 

Macros

#define AVL_EMPTY_NODE   ((avl_t){0})
 Create an empty AVL node, with no child nor parent.
 

Typedefs

typedef int(* avl_compare_t) (const avl_t *left, const avl_t *right)
 Comparison function used during AVL tree operations. More...
 

Functions

static ssize_t avl_height (const avl_t *avl)
 Returns the height of an AVL tree.
 
static bool avl_is_root (const avl_t *avl)
 Returns hether the given AVL node is the root of a tree.
 
const avl_tavl_search (avl_t *root, avl_t *value, avl_compare_t)
 Search a value inside an AVL tree. More...
 
avl_tavl_insert (avl_t **root, avl_t *new, avl_compare_t)
 Insert a new node inside an AVL tree. More...
 
avl_tavl_remove (avl_t **root, avl_t *value, avl_compare_t)
 Remove a value from an AVL tree. More...
 
void avl_print (avl_t *root, void(*print)(const avl_t *))
 Print the content of an AVL tree. More...
 
const avl_tavl_min (const avl_t *root)
 Find the minimum value inside an AVL tree. More...
 
const avl_tavl_max (const avl_t *root)
 Find the maximum value inside an AVL tree. More...
 

Detailed Description