#define ST_ENSURE_MEM(ptr, lvl)
Raise an exception and return NULL if the pointer is NULL.
Definition except.h:110
@ ST_ERROR
error trace level.
Definition trace.h:80
struct StRbNode * st_rb_insrebal(struct StRbNode *root, struct StRbNode *node)
Insert a node in a red-black tree and rebalance the tree.
static struct StRbNode * st_rb_left(struct StRbNode *node)
Get the left child of the given node.
Definition rbtree.h:88
struct StRbNode * st_rb_next(struct StRbNode *node, enum StBstOrder order)
Get the next node for the current red-black tree node and the BST order.
struct StRbNode * st_rb_link(struct StRbNode *node, struct StRbNode *parent)
Prepare a node for insertion in a red-black tree.
struct StRbNode * st_rb_first(struct StRbNode *node, enum StBstOrder order)
Get the first node of the red-black tree for the given BST order.
struct StRbNode * st_rb_parent(struct StRbNode *node)
Get the parent of the red-black tree node.
StBstOrder
Nodes order for a binary search tree.
Definition rbtree.h:50
@ ST_BST_PREORDER
pre-order.
Definition rbtree.h:52
@ ST_BST_INORDER
in-order.
Definition rbtree.h:51
@ ST_BST_POSTORDER
post-order.
Definition rbtree.h:53
StBstChild
Indices for children in a binary search tree.
Definition rbtree.h:61
@ ST_BST_LEFT
left child.
Definition rbtree.h:62
@ ST_BST_RIGHT
right child.
Definition rbtree.h:63
@ ST_BST_N_CHILDREN
number of children.
Definition rbtree.h:64
static struct StRbNode * st_rb_right(struct StRbNode *node)
Get the right child of the given node.
Definition rbtree.h:103
Node of a red-black tree.
#define vx_graph_2vx(graph)
Cast to generic vertex from a graph node.
Definition graph.h:88
#define VX_GRAPH(name, deg, type)
Define the graph.
Definition graph.h:72
#define vx_graph_4vx(v, graph)
Cast from a generic vertex to a graph node.
Definition graph.h:101