|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Top-down red-black binary search tree implementation. More...
#include <tpl_tdRbTree.H>
Classes | |
| struct | Iterator |
| Iterator over tree nodes in sorted order. More... | |
Public Types | |
| using | Node = NodeType< Key > |
| using | key_type = Key |
| using | compare_type = Compare |
Public Member Functions | |
| GenTdRbTree () noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_default_constructible_v< Compare >) | |
| Builds an empty tree with a comparison criteria built by default. | |
| GenTdRbTree (const Compare &__cmp) noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_copy_constructible_v< Compare >) | |
Builds an empty tree with the comparison criteria __cmp. | |
| GenTdRbTree (GenTdRbTree &&other) noexcept(bin_node_detail::nothrow_header_from_v< Node > and bin_node_detail::nothrow_compare_taken_v< Compare >) | |
Takes the nodes and the comparison criteria of other, which is left empty and can take nodes again. | |
| GenTdRbTree & | operator= (GenTdRbTree &&other) noexcept(std::is_nothrow_move_assignable_v< Compare >) |
Takes the nodes and the comparison criteria of other, which is left empty. | |
| GenTdRbTree (const GenTdRbTree &)=delete | |
| Deleted copy constructor (use explicit copy if needed) | |
| GenTdRbTree & | operator= (const GenTdRbTree &)=delete |
| Deleted copy assignment. | |
| void | reset () noexcept |
| Reset tree to empty state (does not free nodes) | |
| void | swap (GenTdRbTree &other) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swaps in constant time the nodes and the comparison criteria of this and other. | |
| virtual | ~GenTdRbTree ()=default |
| size_t | size () const noexcept |
| Get number of nodes in tree (O(1)) | |
| bool | is_empty () const noexcept |
| Check if tree is empty. | |
| Compare & | get_compare () noexcept |
| Get reference to comparator. | |
| const Compare & | get_compare () const noexcept |
| Node * | insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Insert a node into the tree. | |
| Node * | insert_dup (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Insert a node, allowing duplicates. | |
| Node * | search_or_insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for key or insert if not found. | |
| Node * | search (const Key &key) const noexcept(nothrow_compare_v< Compare, Key >) |
| Search for a key in the tree. | |
| Node * | remove (const Key &key) noexcept(nothrow_compare_v< Compare, Key >) |
| Remove and return node with given key. | |
| Node *& | getRoot () noexcept |
| Get reference to root pointer. | |
| Node * | getRoot () const noexcept |
| Get const root pointer | |
| bool | verifyRedBlack () const noexcept |
| Verify that tree satisfies all red-black properties. | |
| bool | verify () const |
| Verify the red-black properties and the order of the keys. | |
Private Member Functions | |
| bool | less (const Key &a, const Key &b) const noexcept(nothrow_compare_v< Compare, Key >) |
| Returns true if a < b according to comparator; it throws what the comparator throws. | |
| bool | equals (const Key &a, const Key &b) const noexcept(nothrow_compare_v< Compare, Key >) |
| Returns true if a == b (neither a < b nor b < a); it throws what the comparator throws. | |
| void | restoreRedCondition (Node *p, Node *&fp, Node *ffp, Node *fffp) noexcept |
| Restore red-black property after color flip creates two consecutive reds. | |
| Node * | searchFlipColorsAndInsert (Node *q) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for insertion point, flipping colors proactively to maintain balance. | |
| Node * | searchFlipColorsAndInsertDup (Node *q) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for insertion point allowing duplicates. | |
| void | colorRootAsRed () noexcept |
| Color root red if safe (both children black) | |
| Node * | searchAndColorRed (const Key &key, Node *&fp) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for key while coloring nodes red for deletion. | |
| void | init () noexcept |
| Initialize header nodes. | |
Static Private Member Functions | |
| static Node * | getSibling (Node *p, Node *fp) noexcept |
| Get sibling of node p whose parent is fp. | |
| static void | flipColors (Node *p) noexcept |
| Flip colors: black parent with two red children becomes red with two black children. | |
| static Node * | gotoLeftAndColorRed (Node *fp, Node *&ffp) noexcept |
| Descend to left child, ensuring current node is red for deletion. | |
| static Node * | gotoRightAndColorRed (Node *fp, Node *&ffp) noexcept |
| Descend to right child, ensuring current node is red for deletion. | |
| static void | findSuccAndSwap (Node *p, Node *&fp) noexcept |
| Find successor and swap with node p for deletion. | |
| static void | findPredAndSwap (Node *p, Node *&fp) noexcept |
| Find predecessor and swap with node p for deletion. | |
| static void | removeAndRendLeafRed (Node *p, Node *fp) noexcept |
| Remove node p and ensure it becomes a red leaf. | |
Private Attributes | |
| Node | headNode |
| Sentinel header node (parent of root) | |
| Node | headParent |
| Sentinel grandparent node. | |
| Node * | head |
| Pointer to header. | |
| Node * | fHead |
| Pointer to header's parent. | |
| Node *& | root |
| Reference to root (right child of head) | |
| Compare | cmp |
| Comparison functor. | |
| size_t | num_nodes |
| Number of nodes in tree. | |
Top-down red-black binary search tree implementation.
This class implements the top-down (single-pass) red-black tree algorithm as described by Guibas and Sedgewick. Unlike the bottom-up approach that requires backtracking after insertion/deletion, this algorithm performs all necessary rotations and color changes while descending the tree.
| NodeType | Node template (typically RbNode or RbNodeVtl). |
| Key | The type of keys stored in the tree. |
| Compare | Comparison functor for ordering keys (default: Aleph::less<Key>). |
Definition at line 98 of file tpl_tdRbTree.H.
| using Aleph::GenTdRbTree< NodeType, Key, Compare >::compare_type = Compare |
Definition at line 103 of file tpl_tdRbTree.H.
| using Aleph::GenTdRbTree< NodeType, Key, Compare >::key_type = Key |
Definition at line 102 of file tpl_tdRbTree.H.
| using Aleph::GenTdRbTree< NodeType, Key, Compare >::Node = NodeType<Key> |
Definition at line 101 of file tpl_tdRbTree.H.
|
inlinenoexcept |
Builds an empty tree with a comparison criteria built by default.
| what | the default construction of the key of a header node or of the comparison criteria throws; nothing when both are noexcept. |
Definition at line 643 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::init().
|
inlineexplicitnoexcept |
Builds an empty tree with the comparison criteria __cmp.
| [in] | __cmp | the comparison criteria, which the tree copies. |
| what | the default construction of the key of a header node or the copy of __cmp throws; nothing when both are noexcept. |
Definition at line 657 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::init().
|
inlinenoexcept |
Takes the nodes and the comparison criteria of other, which is left empty and can take nodes again.
It builds no key, if it can: the key of each of the two header nodes is built by default when that cannot throw; else it is that of the same header node of other, moved, when the move of a key cannot throw (see bin_node_detail::header_from()).
| [in,out] | other | the tree to move from. It keeps its comparison criteria, which are copied: from a const one, or from one that is not const, if they have only that copy. Criteria that cannot be copied are moved, and other keeps criteria that were moved from. |
| what | the copy of the comparison criteria throws, or their move if they cannot be copied; and what the default construction of the key of a header node throws, with a key whose move may throw too. Then other keeps its nodes. Nothing when they are noexcept. |
Definition at line 682 of file tpl_tdRbTree.H.
References BLACK, COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::fHead, Aleph::GenTdRbTree< NodeType, Key, Compare >::head, RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
delete |
Deleted copy constructor (use explicit copy if needed)
|
virtualdefault |
|
inlineprivatenoexcept |
Color root red if safe (both children black)
Definition at line 562 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, LLINK, RED, RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed().
|
inlineprivatenoexcept |
Returns true if a == b (neither a < b nor b < a); it throws what the comparator throws.
Definition at line 124 of file tpl_tdRbTree.H.
References Aleph::and, and Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::remove(), Aleph::GenTdRbTree< NodeType, Key, Compare >::search(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert().
|
inlinestaticprivatenoexcept |
Find predecessor and swap with node p for deletion.
Definition at line 507 of file tpl_tdRbTree.H.
References COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoLeftAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoRightAndColorRed(), LLINK, pred, and RLINK.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::removeAndRendLeafRed().
|
inlinestaticprivatenoexcept |
Find successor and swap with node p for deletion.
Definition at line 452 of file tpl_tdRbTree.H.
References COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoLeftAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoRightAndColorRed(), LLINK, and RLINK.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::removeAndRendLeafRed().
|
inlinestaticprivatenoexcept |
Flip colors: black parent with two red children becomes red with two black children.
Definition at line 184 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, LLINK, RED, and RLINK.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup().
|
inlinenoexcept |
Definition at line 759 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp.
|
inlinenoexcept |
Get reference to comparator.
Definition at line 758 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp.
|
inlinenoexcept |
Get const root pointer
Definition at line 899 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
inlinenoexcept |
Get reference to root pointer.
Definition at line 896 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by TEST().
|
inlinestaticprivatenoexcept |
Get sibling of node p whose parent is fp.
Definition at line 131 of file tpl_tdRbTree.H.
|
inlinestaticprivatenoexcept |
Descend to left child, ensuring current node is red for deletion.
Definition at line 329 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, LLINK, RED, RLINK, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::findPredAndSwap(), Aleph::GenTdRbTree< NodeType, Key, Compare >::findSuccAndSwap(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed().
|
inlinestaticprivatenoexcept |
Descend to right child, ensuring current node is red for deletion.
Definition at line 391 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, LLINK, RED, RLINK, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::findPredAndSwap(), Aleph::GenTdRbTree< NodeType, Key, Compare >::findSuccAndSwap(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed().
|
inlineprivatenoexcept |
Initialize header nodes.
Definition at line 628 of file tpl_tdRbTree.H.
References BLACK, COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::fHead, Aleph::GenTdRbTree< NodeType, Key, Compare >::head, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, and RLINK.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::GenTdRbTree(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::GenTdRbTree().
|
inlinenoexcept |
Insert a node into the tree.
| p | Node to insert (must be red with null children). |
| anything | that the comparison throws; the color flips and rotations done on the way down leave a valid red-black tree, and p is linked after the last comparison, so the tree keeps its keys and size, without p. |
noexcept only if the comparison cannot throw, so that what it throws reaches the caller. Definition at line 772 of file tpl_tdRbTree.H.
References Aleph::and, COLOR, LLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, RED, RLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::root, and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Insert a node, allowing duplicates.
| p | Node to insert. |
| anything | that the comparison throws; then the tree is a valid red-black tree with its keys and size, without p, as in insert(). |
noexcept only if the comparison cannot throw, so that what it throws reaches the caller. Definition at line 798 of file tpl_tdRbTree.H.
References Aleph::and, COLOR, LLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, RED, RLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::root, and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup().
|
inlinenoexcept |
Check if tree is empty.
Definition at line 755 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
inlineprivatenoexcept |
Returns true if a < b according to comparator; it throws what the comparator throws.
Definition at line 116 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp.
|
delete |
Deleted copy assignment.
|
inlinenoexcept |
Takes the nodes and the comparison criteria of other, which is left empty.
| [in,out] | other | the tree to move from. |
*this. | what | the move assignment of the comparison criteria throws, which goes first: then the nodes stay where they were. |
Definition at line 705 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
inlinenoexcept |
Remove and return node with given key.
| key | Key to remove. |
| anything | that the comparison throws; the recolorings and rotations done on the way down leave a valid red-black tree, and the node is unlinked after the last comparison, so the tree keeps its keys and size. |
noexcept only if the comparison cannot throw, so that what it throws reaches the caller. Definition at line 878 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), KEY, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, Aleph::GenTdRbTree< NodeType, Key, Compare >::removeAndRendLeafRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::root, and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed().
|
inlinestaticprivatenoexcept |
Remove node p and ensure it becomes a red leaf.
Definition at line 607 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::findPredAndSwap(), Aleph::GenTdRbTree< NodeType, Key, Compare >::findSuccAndSwap(), LLINK, and RLINK.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::remove().
|
inlinenoexcept |
Reset tree to empty state (does not free nodes)
Definition at line 727 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
inlineprivatenoexcept |
Restore red-black property after color flip creates two consecutive reds.
Definition at line 138 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, LLINK, RED, RLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::root, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup().
|
inlinenoexcept |
Search for a key in the tree.
| key | Key to search for. |
| anything | that the comparison throws; the search does not modify the tree, so it is left as it was. |
noexcept only if the comparison cannot throw, so that what it throws reaches the caller. Definition at line 855 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), KEY, LLINK, RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::search_or_insert(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Search for key or insert if not found.
| p | Node to search or insert. |
| anything | that the comparison throws; then the tree is a valid red-black tree with its keys and size, without p, as in insert(). |
noexcept only if the comparison cannot throw, so that what it throws reaches the caller. Definition at line 824 of file tpl_tdRbTree.H.
References Aleph::and, COLOR, KEY, LLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, RED, RLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::root, Aleph::GenTdRbTree< NodeType, Key, Compare >::search(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert().
|
inlineprivatenoexcept |
Search for key while coloring nodes red for deletion.
Each step leaves a valid red-black tree, so a comparison that throws leaves a valid tree with all its keys.
Definition at line 574 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::colorRootAsRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), Aleph::GenTdRbTree< NodeType, Key, Compare >::fHead, Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoLeftAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoRightAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::head, KEY, LLINK, RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::remove().
|
inlineprivatenoexcept |
Search for insertion point, flipping colors proactively to maintain balance.
Each color flip and rotation leaves a valid red-black tree, and q is linked and counted after the last comparison, so a comparison that throws leaves a valid tree without q.
Definition at line 198 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), Aleph::GenTdRbTree< NodeType, Key, Compare >::fHead, Aleph::GenTdRbTree< NodeType, Key, Compare >::flipColors(), Aleph::GenTdRbTree< NodeType, Key, Compare >::head, KEY, LLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, RED, Aleph::GenTdRbTree< NodeType, Key, Compare >::restoreRedCondition(), RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::insert(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::search_or_insert().
|
inlineprivatenoexcept |
Search for insertion point allowing duplicates.
As searchFlipColorsAndInsert(), a comparison that throws leaves a valid tree without q.
Definition at line 267 of file tpl_tdRbTree.H.
References Aleph::and, BLACK, COLOR, Aleph::GenTdRbTree< NodeType, Key, Compare >::fHead, Aleph::GenTdRbTree< NodeType, Key, Compare >::flipColors(), Aleph::GenTdRbTree< NodeType, Key, Compare >::head, KEY, LLINK, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, RED, Aleph::GenTdRbTree< NodeType, Key, Compare >::restoreRedCondition(), RLINK, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::insert_dup().
|
inlinenoexcept |
|
inlinenoexcept |
Swaps in constant time the nodes and the comparison criteria of this and other.
| [in,out] | other | the tree to swap with. |
| what | the swap of the comparison criteria throws, which goes first: then the nodes stay where they were. |
Definition at line 740 of file tpl_tdRbTree.H.
References Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp, Aleph::GenTdRbTree< NodeType, Key, Compare >::num_nodes, and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
|
inline |
Verify the red-black properties and the order of the keys.
| what | the comparator throws. |
Definition at line 920 of file tpl_tdRbTree.H.
References Aleph::and, Aleph::check_bst(), Aleph::GenTdRbTree< NodeType, Key, Compare >::cmp, Aleph::GenTdRbTree< NodeType, Key, Compare >::root, and Aleph::GenTdRbTree< NodeType, Key, Compare >::verifyRedBlack().
Referenced by TEST().
|
inlinenoexcept |
Verify that tree satisfies all red-black properties.
Checks every node: valid colors, no red node with a red child, and the same number of black nodes on every path down to Node::NullPtr. It does not look at the keys; verify() does.
Definition at line 910 of file tpl_tdRbTree.H.
References is_red_black_tree(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::root.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::verify().
|
private |
Comparison functor.
Definition at line 111 of file tpl_tdRbTree.H.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), Aleph::GenTdRbTree< NodeType, Key, Compare >::get_compare(), Aleph::GenTdRbTree< NodeType, Key, Compare >::get_compare(), Aleph::GenTdRbTree< NodeType, Key, Compare >::less(), Aleph::GenTdRbTree< NodeType, Key, Compare >::operator=(), Aleph::GenTdRbTree< NodeType, Key, Compare >::swap(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::verify().
|
private |
Pointer to header's parent.
Definition at line 109 of file tpl_tdRbTree.H.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::GenTdRbTree(), Aleph::GenTdRbTree< NodeType, Key, Compare >::init(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup().
|
private |
Pointer to header.
Definition at line 108 of file tpl_tdRbTree.H.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::GenTdRbTree(), Aleph::GenTdRbTree< NodeType, Key, Compare >::init(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup().
|
private |
Sentinel header node (parent of root)
Definition at line 106 of file tpl_tdRbTree.H.
|
private |
Sentinel grandparent node.
Definition at line 107 of file tpl_tdRbTree.H.
|
private |
Number of nodes in tree.
Definition at line 112 of file tpl_tdRbTree.H.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::init(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert_dup(), Aleph::GenTdRbTree< NodeType, Key, Compare >::operator=(), Aleph::GenTdRbTree< NodeType, Key, Compare >::remove(), Aleph::GenTdRbTree< NodeType, Key, Compare >::reset(), Aleph::GenTdRbTree< NodeType, Key, Compare >::search_or_insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::GenTdRbTree< NodeType, Key, Compare >::size(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::swap().
|
private |
Reference to root (right child of head)
Definition at line 110 of file tpl_tdRbTree.H.
Referenced by Aleph::GenTdRbTree< NodeType, Key, Compare >::GenTdRbTree(), Aleph::GenTdRbTree< NodeType, Key, Compare >::colorRootAsRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::getRoot(), Aleph::GenTdRbTree< NodeType, Key, Compare >::getRoot(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert_dup(), Aleph::GenTdRbTree< NodeType, Key, Compare >::is_empty(), Aleph::GenTdRbTree< NodeType, Key, Compare >::operator=(), Aleph::GenTdRbTree< NodeType, Key, Compare >::remove(), Aleph::GenTdRbTree< NodeType, Key, Compare >::reset(), Aleph::GenTdRbTree< NodeType, Key, Compare >::restoreRedCondition(), Aleph::GenTdRbTree< NodeType, Key, Compare >::search(), Aleph::GenTdRbTree< NodeType, Key, Compare >::search_or_insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::GenTdRbTree< NodeType, Key, Compare >::swap(), Aleph::GenTdRbTree< NodeType, Key, Compare >::verify(), and Aleph::GenTdRbTree< NodeType, Key, Compare >::verifyRedBlack().