|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Hybrid top-down/bottom-up red-black tree. More...
#include <tpl_hRbTree.H>
Classes | |
| struct | Iterator |
| In-order iterator. More... | |
Public Types | |
| using | Color = unsigned char |
| Color type for red-black nodes. | |
| using | Node = RbNode< Key > |
| The node type used by this tree. | |
| using | key_type = Key |
| The key type stored in nodes. | |
Public Member Functions | |
| Compare & | key_comp () noexcept |
| Returns a reference to the comparison functor. | |
| const Compare & | key_comp () const noexcept |
| Compare & | get_compare () noexcept |
| Alias for key_comp() | |
| constexpr const Compare & | get_compare () const noexcept |
| HtdRbTree () noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_default_constructible_v< Compare > and std::is_nothrow_constructible_v< Compare, Compare & >) | |
| Builds an empty tree with a comparison criteria built by default. | |
| HtdRbTree (Compare __cmp) noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_constructible_v< Compare, Compare & >) | |
Builds an empty tree with the comparison criteria __cmp. | |
| void | swap (HtdRbTree &tree) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swaps in constant time the nodes and the comparison criteria of this and tree. | |
| HtdRbTree (HtdRbTree &&tree) 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 tree, which is left empty and can take nodes again. | |
| HtdRbTree & | operator= (HtdRbTree &&tree) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swaps the nodes and the comparison criteria with tree. | |
| HtdRbTree (const HtdRbTree &)=delete | |
| Copy constructor deleted. | |
| HtdRbTree & | operator= (const HtdRbTree &)=delete |
| Copy assignment deleted. | |
| virtual | ~HtdRbTree ()=default |
| Virtual destructor. | |
| constexpr bool | is_empty () const noexcept |
| Check if tree is empty. | |
| constexpr size_t | size () const noexcept |
| Get number of nodes in tree. | |
| void | reset () noexcept |
| Reset tree (does not free nodes) | |
| Node * | insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Insert a node into the tree. | |
| Node * | search_or_insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for key or insert if not found. | |
| Node * | insert_dup (Node *p) noexcept(nothrow_compare_v< Compare, Key >) |
| Insert allowing duplicate keys. | |
| Node * | search (const Key &key) const noexcept(nothrow_compare_v< Compare, Key >) |
| Search for a key. | |
| Node * | remove (const Key &key) noexcept(nothrow_compare_v< Compare, Key >) |
| Remove node with given key. | |
| Node *& | getRoot () noexcept |
| Get reference to root pointer. | |
| Node * | getRoot () const noexcept |
| Get root pointer (const) | |
| bool | verifyRedBlack () const noexcept |
| Verify the red-black properties of every node. | |
| bool | verify () const |
| Verify tree is a valid red-black BST. | |
Private Types | |
| using | Path = InlineStack< Node *, Node::MaxHeight+1 > |
Private Member Functions | |
| void | restoreRedCondition (Node *p, Node *&fp, Node *ffp, Node *fffp) |
| Restore red-black condition after insertion. | |
| Node * | searchFlipColorsAndInsert (Node *q) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for insertion point with proactive color flipping. | |
| Node * | searchFlipColorsAndInsertDup (Node *q) noexcept(nothrow_compare_v< Compare, Key >) |
| Like searchFlipColorsAndInsert but allows duplicate keys; as it, a comparison that throws leaves a valid tree without q. | |
| Node * | searchAndBuildPath (const Key &key, Path &path) noexcept(nothrow_compare_v< Compare, Key >) |
| Search for key while building path stack. | |
| void | findSuccAndSwap (Node *p, Node *&fp, Path &path) noexcept |
| Find successor and swap with node to delete. | |
| void | balanceDownAndColor (Node *p, Node *&fp, Node *&sp, Path &path) noexcept |
| Balance down a violating black node. | |
| void | rotateNephewAndColor (Node *fp, Node *sp, Node *np, Path &path) noexcept |
| Rotate nephew up and recolor to fix violation. | |
| void | doubleRotateNephewAndColor (Node *fp, Node *sp, Node *snp, Path &path) noexcept |
| Double rotation and recolor to fix violation. | |
| void | removeAndFixBlackCondition (Node *q, Path &path) noexcept |
| Remove node and fix any black-height violations. | |
Static Private Member Functions | |
| static Node * | getSibling (Node *p, Node *fp) noexcept |
| Returns sibling of p given its parent fp. | |
| static void | flipColors (Node *p) noexcept |
| Flip colors of a black node with two red children. | |
| static void | colorSiblingAsRed (Node *sp) noexcept |
| Color sibling red to propagate violation upward. | |
| static void | colorParentAndSibling (Node *fp, Node *sp) noexcept |
| Recolor parent and sibling to fix violation. | |
Private Attributes | |
| Node | headNode |
| Auxiliary node, parent of root. | |
| Node | headParent |
| Auxiliary node, grandparent of root. | |
| Node | headGrandParent |
| Auxiliary node, great-grandparent of root. | |
| Node * | head |
| Pointer to head node. | |
| Node * | fHead |
| Pointer to head's parent. | |
| Node * | ffHead |
| Pointer to head's grandparent. | |
| Node *& | root |
| Reference to root (right child of head) | |
| size_t | node_count = 0 |
| Number of nodes in tree. | |
| Compare | cmp |
| Comparison functor. | |
Hybrid top-down/bottom-up red-black tree.
This class implements a self-balancing binary search tree using the red-black tree algorithm with a hybrid approach:
| Key | The type of keys stored in the tree |
| Compare | Comparison functor (default: Aleph::less<Key>) |
Definition at line 85 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::Color = unsigned char |
Color type for red-black nodes.
Definition at line 89 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::key_type = Key |
The key type stored in nodes.
Definition at line 779 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::Node = RbNode<Key> |
The node type used by this tree.
Definition at line 92 of file tpl_hRbTree.H.
|
private |
Definition at line 113 of file tpl_hRbTree.H.
|
inlinenoexcept |
Builds an empty tree with a comparison criteria built by default.
It is a constructor apart from the one that takes the comparison, and not a default argument of that one: GCC and Clang do not count a default argument in the noexcept of the implicit default constructor of a tree that inherits these, and what the construction of the comparison threw would end the program there.
| what | the default construction of the key of a header node or of the comparison, or the copy of the comparison, throws; nothing when they are noexcept. |
Definition at line 806 of file tpl_hRbTree.H.
|
inlinenoexcept |
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. The copy is from a Compare that is not const, which a comparison may have apart from the one from a const one. |
Definition at line 823 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::HtdRbTree< Key, Compare >::ffHead, Aleph::HtdRbTree< Key, Compare >::fHead, Aleph::HtdRbTree< Key, Compare >::head, RbNode< Key >::NullPtr, and RLINK.
|
inlinenoexcept |
Takes the nodes and the comparison criteria of tree, which is left empty and can take nodes again.
It builds no key, if it can: the key of each of the three header nodes is built by default when that cannot throw; else it is that of the same header node of tree, moved, when the move of a key cannot throw (see bin_node_detail::header_from()).
| [in,out] | tree | 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 tree 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 tree keeps its nodes. Nothing when they are noexcept. |
Definition at line 873 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::HtdRbTree< Key, Compare >::ffHead, Aleph::HtdRbTree< Key, Compare >::fHead, Aleph::HtdRbTree< Key, Compare >::head, RbNode< Key >::NullPtr, RLINK, and Aleph::HtdRbTree< Key, Compare >::root.
|
delete |
Copy constructor deleted.
|
virtualdefault |
Virtual destructor.
|
inlineprivatenoexcept |
Balance down a violating black node.
When sibling is red, rotate to make it black. This ensures the sibling-black cases can be applied.
| p | Violating node (black, missing a black node) |
| fp | Parent of p (updated) |
| sp | Sibling of p (updated to new sibling, which will be black) |
| path | The path from the head node to fp; its top is updated to the new parent of fp. |
Definition at line 511 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RED, RLINK, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinestaticprivatenoexcept |
Recolor parent and sibling to fix violation.
Case: parent is red. Swapping colors fixes the tree.
| fp | Parent (red) |
| sp | Sibling (black) |
Definition at line 642 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RED, and RLINK.
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinestaticprivatenoexcept |
Color sibling red to propagate violation upward.
After this, fp becomes the new violating node.
| sp | Sibling (black, both children black) |
Definition at line 629 of file tpl_hRbTree.H.
References BLACK, COLOR, and RED.
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlineprivatenoexcept |
Double rotation and recolor to fix violation.
Case: nephew snp is red and on the "inside" (opposite side from sibling). Double rotation (rotate sibling, then parent) fixes the tree.
| fp | Parent of violating node |
| sp | Sibling (black) |
| snp | Sibling's nephew (red, opposite side from sp) |
| path | The path from the head node to fp; its top is the parent of fp. |
Definition at line 593 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RED, RLINK, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlineprivatenoexcept |
Find successor and swap with node to delete.
Used during deletion when the node has two children. Finds the in-order successor and swaps pointers (not contents).
| p | Node to delete |
| fp | Parent of p (updated to point to new position) |
| path | The path from the head node to p; the successor takes the place of p in it, and the nodes down to the successor are pushed. |
Definition at line 426 of file tpl_hRbTree.H.
References COLOR, LLINK, log(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, and RLINK.
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinestaticprivatenoexcept |
Flip colors of a black node with two red children.
The black node becomes red and its children become black. This is the key operation for top-down insertion.
| p | Node to flip (must be black with two red children) |
Definition at line 194 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RbNode< Key >::NullPtr, RED, and RLINK.
Referenced by Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
inlineconstexprnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 791 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Alias for key_comp()
Definition at line 788 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Get root pointer (const)
Definition at line 1069 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::root.
|
inlinenoexcept |
Get reference to root pointer.
Definition at line 1066 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::root.
Referenced by TEST().
|
inlinestaticprivatenoexcept |
Returns sibling of p given its parent fp.
Definition at line 120 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinenoexcept |
Insert a node into the tree.
| p | Node to insert (must have COLOR=RED and 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 943 of file tpl_hRbTree.H.
References COLOR, LLINK, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, RLINK, Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert().
Referenced by Aleph::HtdRbTree< Key, Compare >::search_or_insert(), and TEST().
|
inlinenoexcept |
Insert allowing duplicate keys.
| 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 1000 of file tpl_hRbTree.H.
References COLOR, LLINK, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, RLINK, Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
inlineconstexprnoexcept |
Check if tree is empty.
Definition at line 920 of file tpl_hRbTree.H.
References RbNode< Key >::NullPtr, and Aleph::HtdRbTree< Key, Compare >::root.
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 785 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Returns a reference to the comparison functor.
Definition at line 782 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
delete |
Copy assignment deleted.
|
inlinenoexcept |
Swaps the nodes and the comparison criteria with tree.
| [in,out] | tree | the tree to swap with. |
*this. | what | the swap of the comparison criteria throws, which goes first: then the nodes stay where they were. |
Definition at line 904 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::swap().
|
inlinenoexcept |
Remove node with given key.
| key | Key to remove |
| anything | that the comparison throws; the tree changes only after the last comparison, 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 1040 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, KEY, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition(), RbNode< Key >::reset(), Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath().
|
inlineprivatenoexcept |
Remove node and fix any black-height violations.
Performs the actual BST deletion (bypass or swap with successor), then walks up the path fixing violations.
| q | Node to remove (must be on top of path stack) |
| path | The path from the head node to q, as built by searchAndBuildPath(); it is consumed. |
Definition at line 662 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::balanceDownAndColor(), BLACK, COLOR, Aleph::HtdRbTree< Key, Compare >::colorParentAndSibling(), Aleph::HtdRbTree< Key, Compare >::colorSiblingAsRed(), Aleph::HtdRbTree< Key, Compare >::doubleRotateNephewAndColor(), Aleph::HtdRbTree< Key, Compare >::findSuccAndSwap(), Aleph::HtdRbTree< Key, Compare >::getSibling(), LLINK, RbNode< Key >::NullPtr, RED, RLINK, Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::rotateNephewAndColor().
Referenced by Aleph::HtdRbTree< Key, Compare >::remove().
|
inlinenoexcept |
Reset tree (does not free nodes)
Definition at line 926 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, and Aleph::HtdRbTree< Key, Compare >::root.
|
inlineprivate |
Restore red-black condition after insertion.
Called when we have two consecutive red nodes (p and fp are both red). Performs rotations to fix the violation.
| p | Violating node (red) |
| fp | Parent of p (red) - may be updated |
| ffp | Grandparent of p (black) |
| fffp | Great-grandparent of p |
Definition at line 138 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RED, RLINK, Aleph::HtdRbTree< Key, Compare >::root, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
inlineprivatenoexcept |
Rotate nephew up and recolor to fix violation.
Case: nephew np is red and on the "outside" (same side as sibling). Single rotation fixes the tree.
| fp | Parent of violating node |
| sp | Sibling (black) |
| np | Nephew (red, same side as sp) |
| path | The path from the head node to fp; its top is the parent of fp. |
Definition at line 558 of file tpl_hRbTree.H.
References BLACK, COLOR, LLINK, RED, RLINK, Aleph::rotate_to_left(), and Aleph::rotate_to_right().
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinenoexcept |
Search for a key.
| 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 1025 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::root, and Aleph::searchInBinTree().
Referenced by Aleph::HtdRbTree< Key, Compare >::search_or_insert().
|
inlinenoexcept |
Search for key or insert if not found.
| p | Node to insert if key not found |
| 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 969 of file tpl_hRbTree.H.
References COLOR, Aleph::HtdRbTree< Key, Compare >::insert(), KEY, LLINK, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, RLINK, Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::search().
|
inlineprivatenoexcept |
Search for key while building path stack.
Used for deletion. The path stack is needed to walk back up the tree when fixing violations.
| key | Key to search for |
| path | The path, which receives the head node and the nodes visited down to the returned one. |
| anything | that the comparison throws; the search does not modify the tree. It is noexcept only if the comparison cannot throw. |
Definition at line 368 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, Aleph::HtdRbTree< Key, Compare >::head, KEY, LLINK, log(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RLINK, and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by Aleph::HtdRbTree< Key, Compare >::remove().
|
inlineprivatenoexcept |
Search for insertion point with proactive color flipping.
Descends the tree looking for where to insert q. During descent, any node with two red children has its colors flipped preemptively. 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.
| q | Node to insert |
| anything | that the comparison throws; it is noexcept only if the comparison cannot throw. |
Definition at line 217 of file tpl_hRbTree.H.
References BLACK, Aleph::HtdRbTree< Key, Compare >::cmp, COLOR, Aleph::HtdRbTree< Key, Compare >::ffHead, Aleph::HtdRbTree< Key, Compare >::fHead, Aleph::HtdRbTree< Key, Compare >::flipColors(), Aleph::HtdRbTree< Key, Compare >::head, KEY, LLINK, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::HtdRbTree< Key, Compare >::restoreRedCondition(), RLINK, and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by Aleph::HtdRbTree< Key, Compare >::insert().
|
inlineprivatenoexcept |
Like searchFlipColorsAndInsert but allows duplicate keys; as it, a comparison that throws leaves a valid tree without q.
Definition at line 288 of file tpl_hRbTree.H.
References BLACK, Aleph::HtdRbTree< Key, Compare >::cmp, COLOR, Aleph::HtdRbTree< Key, Compare >::ffHead, Aleph::HtdRbTree< Key, Compare >::fHead, Aleph::HtdRbTree< Key, Compare >::flipColors(), Aleph::HtdRbTree< Key, Compare >::head, KEY, LLINK, Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::HtdRbTree< Key, Compare >::restoreRedCondition(), RLINK, and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by Aleph::HtdRbTree< Key, Compare >::insert_dup().
|
inlineconstexprnoexcept |
Get number of nodes in tree.
Definition at line 923 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::node_count.
|
inlinenoexcept |
Swaps in constant time the nodes and the comparison criteria of this and tree.
| [in,out] | tree | 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 847 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, Aleph::HtdRbTree< Key, Compare >::node_count, and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by Aleph::HtdRbTree< Key, Compare >::operator=().
|
inline |
Verify tree is a valid red-black BST.
| what | the comparator throws. |
Definition at line 1090 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, is_red_black_bst(), and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by TEST().
|
inlinenoexcept |
Verify the red-black properties of every node.
Checks valid colors, that no red node has a red child, and that every path down to Node::NullPtr crosses the same number of black nodes. It does not look at the keys; verify() does.
Definition at line 1080 of file tpl_hRbTree.H.
References is_red_black_tree(), and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by TEST().
|
private |
Comparison functor.
Definition at line 117 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::get_compare(), Aleph::HtdRbTree< Key, Compare >::get_compare(), Aleph::HtdRbTree< Key, Compare >::key_comp(), Aleph::HtdRbTree< Key, Compare >::key_comp(), Aleph::HtdRbTree< Key, Compare >::remove(), Aleph::HtdRbTree< Key, Compare >::search(), Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::HtdRbTree< Key, Compare >::swap(), and Aleph::HtdRbTree< Key, Compare >::verify().
|
private |
Pointer to head's grandparent.
Definition at line 103 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
private |
Pointer to head's parent.
Definition at line 102 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
private |
Pointer to head node.
Definition at line 101 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
private |
Auxiliary node, great-grandparent of root.
Definition at line 99 of file tpl_hRbTree.H.
|
private |
Auxiliary node, parent of root.
Definition at line 97 of file tpl_hRbTree.H.
|
private |
Auxiliary node, grandparent of root.
Definition at line 98 of file tpl_hRbTree.H.
|
private |
Number of nodes in tree.
Definition at line 115 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::findSuccAndSwap(), Aleph::HtdRbTree< Key, Compare >::insert(), Aleph::HtdRbTree< Key, Compare >::insert_dup(), Aleph::HtdRbTree< Key, Compare >::remove(), Aleph::HtdRbTree< Key, Compare >::reset(), Aleph::HtdRbTree< Key, Compare >::search_or_insert(), Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::HtdRbTree< Key, Compare >::size(), and Aleph::HtdRbTree< Key, Compare >::swap().
|
private |
Reference to root (right child of head)
Definition at line 104 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::HtdRbTree(), Aleph::HtdRbTree< Key, Compare >::getRoot(), Aleph::HtdRbTree< Key, Compare >::getRoot(), Aleph::HtdRbTree< Key, Compare >::insert(), Aleph::HtdRbTree< Key, Compare >::insert_dup(), Aleph::HtdRbTree< Key, Compare >::is_empty(), Aleph::HtdRbTree< Key, Compare >::remove(), Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition(), Aleph::HtdRbTree< Key, Compare >::reset(), Aleph::HtdRbTree< Key, Compare >::restoreRedCondition(), Aleph::HtdRbTree< Key, Compare >::search(), Aleph::HtdRbTree< Key, Compare >::search_or_insert(), Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert(), Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::HtdRbTree< Key, Compare >::swap(), Aleph::HtdRbTree< Key, Compare >::verify(), and Aleph::HtdRbTree< Key, Compare >::verifyRedBlack().