Definition in file eg_bbtree.c.
#include "eg_bbtree.h"
Include dependency graph for eg_bbtree.c:

Go to the source code of this file.
| #define | EGbbtreeLeftDepth(__node) ((__node)->left?(__node)->left->depth:0U) |
| Macro to access the depth of the left child of a nodo. | |
| #define | EGbbtreeRightDepth(__node) ((__node)->right?(__node)->right->depth:0U) |
| Macro to access the depth of the right child of a nodo. | |
| EGbbtreeNode_t * | EGbbtreeAdd (EGbbtree_t *tree, void *elem) |
| Add a new element to the tree. | |
| static int | EGbbtreeBalance (EGbbtree_t *tree, EGbbtreeNode_t **p_node) |
| This function balances a tree by rotations, starting in the given node and working upwards. | |
| int | EGbbtreeClear (EGbbtree_t *tree, EGfree_f dataFree) |
| Given an initialized bbtree, left it at it initial state (just after EGnewBbtree). | |
| int | EGbbtreeClearMP (EGbbtree_t *tree, EGfreeMP_f dataFree, EGmemPool_t *datamem) |
| Given an initialized bbtree, left it at it initial state (just after EGnewBbtree). | |
| void | EGbbtreeDisplay (EGbbtree_t *tree, EGdisplay_f dataDisplay, FILE *file) |
| Display function for the tree. | |
| EGbbtreeNode_t * | EGbbtreeFind (EGbbtree_t *tree, const void *elem) |
| Find an element in the tree. | |
| EGbbtreeNode_t * | EGbbtreeMax (EGbbtree_t *tree) |
| Return the maximum element in the tree. | |
| EGbbtreeNode_t * | EGbbtreeMin (EGbbtree_t *tree) |
| Return the minimum element in the tree. | |
| EGbbtreeNode_t * | EGbbtreePredecessor (EGbbtreeNode_t *node) |
| , get the predecessor of the current node. | |
| int | EGbbtreeRemove (EGbbtree_t *tree, EGbbtreeNode_t *node) |
| Delete an element from the tree. | |
| static int | EGbbtreeRotateLeft (EGbbtree_t *tree, EGbbtreeNode_t **p_node) |
| Rotate the given node to the left, and update the correspondig depths. | |
| static int | EGbbtreeRotateRight (EGbbtree_t *tree, EGbbtreeNode_t **p_node) |
| Rotate the given node to the right, and update the correspondig depths. | |
| EGbbtreeNode_t * | EGbbtreeSuccessor (EGbbtreeNode_t *node) |
| , get the successor of the current node. | |
| static int | EGbbtreeUpdateDepth (EGbbtreeNode_t *const p_node) |
| Update the depth of a node, this function assumes that the depth of the sons of the node are correctly set-up. | |
| void | EGfreeBbtree (void *tree) |
| Defeault destructor. | |
| EGbbtree_t * | EGnewBbtree (EGmemPool_t *mem, EGcompare_f compare) |
| Defeault constructor. |
|
|
Macro to access the depth of the left child of a nodo.
Definition at line 223 of file eg_bbtree.c. |
|
|
Macro to access the depth of the right child of a nodo.
Definition at line 227 of file eg_bbtree.c. |
|
||||||||||||
|
Add a new element to the tree.
Definition at line 401 of file eg_bbtree.c. Here is the call graph for this function: ![]() |
|
||||||||||||
|
This function balances a tree by rotations, starting in the given node and working upwards.
Definition at line 325 of file eg_bbtree.c. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Given an initialized bbtree, left it at it initial state (just after EGnewBbtree).
Definition at line 102 of file eg_bbtree.c. |
|
||||||||||||||||
|
Given an initialized bbtree, left it at it initial state (just after EGnewBbtree).
Definition at line 150 of file eg_bbtree.c. |
|
||||||||||||||||
|
Display function for the tree.
Definition at line 659 of file eg_bbtree.c. |
|
||||||||||||
|
Find an element in the tree.
Definition at line 196 of file eg_bbtree.c. |
|
|
Return the maximum element in the tree.
Definition at line 729 of file eg_bbtree.c. |
|
|
Return the minimum element in the tree.
Definition at line 711 of file eg_bbtree.c. |
|
|
, get the predecessor of the current node.
Definition at line 455 of file eg_bbtree.c. |
|
||||||||||||
|
Delete an element from the tree.
Definition at line 524 of file eg_bbtree.c. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Rotate the given node to the left, and update the correspondig depths.
Definition at line 286 of file eg_bbtree.c. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Rotate the given node to the right, and update the correspondig depths.
Definition at line 248 of file eg_bbtree.c. Here is the call graph for this function: ![]() |
|
|
, get the successor of the current node.
Definition at line 487 of file eg_bbtree.c. |
|
|
Update the depth of a node, this function assumes that the depth of the sons of the node are correctly set-up.
Definition at line 232 of file eg_bbtree.c. |
|
|
Defeault destructor.
Definition at line 56 of file eg_bbtree.c. |
|
||||||||||||
|
Defeault constructor.
Definition at line 37 of file eg_bbtree.c. |
1.4.5