liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
struct | a_rbt_node |
instance structure for red–black binary search tree node More... | |
union | a_rbt |
instance structure for red–black binary search tree root More... | |
Macros | |
#define | A_RBT_ROOT {A_NULL} |
#define | a_rbt_entry(ptr, type, member) |
access the struct for this entry | |
#define | a_rbt_foreach(cur, root) |
iterate over a red–black binary search tree in-order | |
#define | a_rbt_foreach_reverse(cur, root) |
iterate over a red–black binary search tree in-order reverse | |
#define | a_rbt_pre_foreach(cur, root) |
iterate over a red–black binary search tree preorder | |
#define | a_rbt_pre_foreach_reverse(cur, root) |
iterate over a red–black binary search tree preorder reverse | |
#define | a_rbt_post_foreach(cur, root) |
iterate over a red–black binary search tree postorder | |
#define | a_rbt_post_foreach_reverse(cur, root) |
iterate over a red–black binary search tree postorder reverse | |
#define | a_rbt_fortear(cur, next, root) |
tear a red–black binary search tree using postorder traversal | |
Typedefs | |
typedef struct a_rbt_node | a_rbt_node |
instance structure for red–black binary search tree node | |
typedef union a_rbt | a_rbt |
instance structure for red–black binary search tree root | |
Functions | |
a_rbt_node * | a_rbt_parent (a_rbt_node const *node) |
access parent of red–black binary search tree node | |
a_rbt_node * | a_rbt_init (a_rbt_node *node, a_rbt_node *parent) |
initialize for red–black binary search tree node | |
void | a_rbt_root (a_rbt *root) |
initialize for red–black binary search tree root | |
a_rbt_node * | a_rbt_head (a_rbt const *root) |
access head node of red–black binary search tree in-order | |
a_rbt_node * | a_rbt_tail (a_rbt const *root) |
access tail node of red–black binary search tree in-order | |
a_rbt_node * | a_rbt_next (a_rbt_node *node) |
access next node of red–black binary search tree node in-order | |
a_rbt_node * | a_rbt_prev (a_rbt_node *node) |
access prev node of red–black binary search tree node in-order | |
a_rbt_node * | a_rbt_pre_next (a_rbt_node *node) |
access next node of red–black binary search tree node preorder | |
a_rbt_node * | a_rbt_pre_prev (a_rbt_node *node) |
access prev node of red–black binary search tree node preorder | |
a_rbt_node * | a_rbt_post_head (a_rbt const *root) |
access head node of red–black binary search tree postorder | |
a_rbt_node * | a_rbt_post_tail (a_rbt const *root) |
access tail node of red–black binary search tree postorder | |
a_rbt_node * | a_rbt_post_next (a_rbt_node *node) |
access next node of red–black binary search tree node postorder | |
a_rbt_node * | a_rbt_post_prev (a_rbt_node *node) |
access prev node of red–black binary search tree node postorder | |
a_rbt_node * | a_rbt_tear (a_rbt *root, a_rbt_node **next) |
tear a node from red–black binary search tree | |
a_rbt_node * | a_rbt_search (a_rbt const *root, void const *ctx, int(*cmp)(void const *, void const *)) |
search specified content from red–black binary search tree | |
a_rbt_node * | a_rbt_insert (a_rbt *root, a_rbt_node *node, int(*cmp)(void const *, void const *)) |
insert specified node into red–black binary search tree | |
void | a_rbt_insert_adjust (a_rbt *root, a_rbt_node *node) |
rebalance the tree after insertion of the specified node | |
void | a_rbt_remove (a_rbt *root, a_rbt_node *node) |
remove specified node from red–black binary search tree | |
#define a_rbt_entry | ( | ptr, | |
type, | |||
member ) |
access the struct for this entry
ptr | the &a_rbt_node pointer |
type | the type of the struct this is embedded in |
member | the name of the a_rbt_node within the struct |
#define a_rbt_foreach | ( | cur, | |
root ) |
iterate over a red–black binary search tree in-order
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
#define a_rbt_foreach_reverse | ( | cur, | |
root ) |
iterate over a red–black binary search tree in-order reverse
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
#define a_rbt_fortear | ( | cur, | |
next, | |||
root ) |
tear a red–black binary search tree using postorder traversal
cur | the &a_rbt_node to use as a loop counter |
next | the &a_rbt_node to use as next node |
root | red–black binary search tree root |
#define a_rbt_post_foreach | ( | cur, | |
root ) |
iterate over a red–black binary search tree postorder
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
#define a_rbt_post_foreach_reverse | ( | cur, | |
root ) |
iterate over a red–black binary search tree postorder reverse
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
#define a_rbt_pre_foreach | ( | cur, | |
root ) |
iterate over a red–black binary search tree preorder
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
#define a_rbt_pre_foreach_reverse | ( | cur, | |
root ) |
iterate over a red–black binary search tree preorder reverse
cur | the &a_rbt_node to use as a loop counter |
root | red–black binary search tree root |
a_rbt_node * a_rbt_head | ( | a_rbt const * | root | ) |
access head node of red–black binary search tree in-order
[in] | root | red–black binary search tree root |
a_rbt_node * a_rbt_init | ( | a_rbt_node * | node, |
a_rbt_node * | parent ) |
initialize for red–black binary search tree node
[in] | node | node to be initialized |
[in] | parent | node parent |
a_rbt_node * a_rbt_insert | ( | a_rbt * | root, |
a_rbt_node * | node, | ||
int(* | cmp )(void const *, void const *) ) |
insert specified node into red–black binary search tree
[in] | root | red–black binary search tree root |
[in] | node | specified tree node |
[in] | cmp | a function that compares two nodes
|
void a_rbt_insert_adjust | ( | a_rbt * | root, |
a_rbt_node * | node ) |
rebalance the tree after insertion of the specified node
[in] | root | red–black binary search tree root |
[in] | node | insert tree node |
a_rbt_node * a_rbt_next | ( | a_rbt_node * | node | ) |
access next node of red–black binary search tree node in-order
[in] | node | red–black binary search tree node |
a_rbt_node * a_rbt_parent | ( | a_rbt_node const * | node | ) |
access parent of red–black binary search tree node
[in] | node | points to red–black binary search tree node |
a_rbt_node * a_rbt_post_head | ( | a_rbt const * | root | ) |
access head node of red–black binary search tree postorder
[in] | root | red–black binary search tree root |
a_rbt_node * a_rbt_post_next | ( | a_rbt_node * | node | ) |
access next node of red–black binary search tree node postorder
[in] | node | red–black binary search tree node |
a_rbt_node * a_rbt_post_prev | ( | a_rbt_node * | node | ) |
access prev node of red–black binary search tree node postorder
[in] | node | red–black binary search tree node |
a_rbt_node * a_rbt_post_tail | ( | a_rbt const * | root | ) |
access tail node of red–black binary search tree postorder
[in] | root | red–black binary search tree root |
a_rbt_node * a_rbt_pre_next | ( | a_rbt_node * | node | ) |
access next node of red–black binary search tree node preorder
[in] | node | red–black binary search tree node |
a_rbt_node * a_rbt_pre_prev | ( | a_rbt_node * | node | ) |
access prev node of red–black binary search tree node preorder
[in] | node | red–black binary search tree node |
a_rbt_node * a_rbt_prev | ( | a_rbt_node * | node | ) |
access prev node of red–black binary search tree node in-order
[in] | node | red–black binary search tree node |
void a_rbt_remove | ( | a_rbt * | root, |
a_rbt_node * | node ) |
remove specified node from red–black binary search tree
[in] | root | red–black binary search tree root |
[in] | node | specified tree node |
void a_rbt_root | ( | a_rbt * | root | ) |
initialize for red–black binary search tree root
[in,out] | root | red–black binary search tree root |
a_rbt_node * a_rbt_search | ( | a_rbt const * | root, |
void const * | ctx, | ||
int(* | cmp )(void const *, void const *) ) |
search specified content from red–black binary search tree
[in] | root | red–black binary search tree root |
[in] | ctx | specified content |
[in] | cmp | a function that compares two nodes
|
a_rbt_node * a_rbt_tail | ( | a_rbt const * | root | ) |
access tail node of red–black binary search tree in-order
[in] | root | red–black binary search tree root |
a_rbt_node * a_rbt_tear | ( | a_rbt * | root, |
a_rbt_node ** | next ) |
tear a node from red–black binary search tree
[in] | root | red–black binary search tree root |
[in,out] | next | input starting node or, if null, root node. output next node or null. |