25 #ifndef MPBLOCKS_RED_BLACK_EXAMPLETRAITS_H_
26 #define MPBLOCKS_RED_BLACK_EXAMPLETRAITS_H_
78 #endif // MPBLOCKS_RED_BLACK_EXAMPLETRAITS_H_
Node * NodeRef
some type which stores uniquely identifies nodes, for instance a node pointer or an index into an arr...
an example traits struction from which a red-black tree may be instantiated
NodeRef & left(NodeRef N)
return the left child of N
A node in a redblack tree.
double Key
the key type, must be comparable, note that this typedef is not required, the tree will operate on wh...
Color & color(NodeRef N)
return the color of node N
NodeRef & right(NodeRef N)
return the right child of N
NodeRef & parent(NodeRef N)
return the parent node of N
BasicNode< ExampleTraits > Node
this type is not required by the interface, but if you just need a simple node type then this one wil...
a callable type which implements the primitives required to access fields of a node ...
Key & key(NodeRef N)
return the key associated with N
void swapKey(NodeRef a, NodeRef b)
swap the keys in two nodes