70# define COLOR(p) ((p)->getColor())
123 template <
class Node>
126 if (p == Node::NullPtr)
132 if (LLINK(p) == Node::NullPtr and RLINK(p) == Node::NullPtr)
156 template <
class Node>
159 if (node == Node::NullPtr)
184 template <
class Node>
207 template <
class Node,
class Compare>
213 return check_bst(node,
cmp);
SentinelCtor
Tag type for sentinel node construction.
WeightedDigraph::Node Node
Data portion of a Red-Black tree node.
Color & getColor()
Get reference to node color.
Color color
Node color: RED or BLACK.
RbNode_Data(SentinelCtor)
Sentinel constructor creates a black node.
void reset()
Reset node to red (for reinsertion)
RbNode_Data()
Default constructor creates a red node.
Declare RbNode type with 128-byte pool allocation.
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_max_function > > max(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
int cmp(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
#define DECLARE_BINNODE_SENTINEL(Name, height, Control_Data)
Specify tree node for a binary tree.
#define COLOR(p)
Access the color of node p.
bool is_red_black_bst(Node *node, Compare &cmp)
Verify that tree is both a valid RB tree and valid BST.
bool test_black_condition(Node *p, int &max, int bh=0)
Test the black-height property of an RB tree.
#define BLACK
Black color constant.
#define RED
Red color constant (newly inserted nodes are red)
bool is_red_black_tree(Node *node)
Test RB properties for entire subtree.
unsigned char Color
Color type for RB nodes.
bool is_red_black(Node *node)
Test all Red-Black tree properties for a node.
Basic binary tree node definitions.