|
Aleph-w 3.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 (Compare __cmp=Compare()) noexcept | |
| Default constructor. | |
| void | swap (HtdRbTree &tree) noexcept |
| Swap contents with another tree. | |
| HtdRbTree (HtdRbTree &&tree) noexcept | |
| Move constructor. | |
| HtdRbTree & | operator= (HtdRbTree &&tree) noexcept |
| Move assignment. | |
| 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 |
| Insert a node into the tree. | |
| Node * | search_or_insert (Node *p) noexcept |
| Search for key or insert if not found. | |
| Node * | insert_dup (Node *p) noexcept |
| Insert allowing duplicate keys. | |
| Node * | search (const Key &key) const noexcept |
| Search for a key. | |
| Node * | remove (const Key &key) noexcept |
| Remove node with given key. | |
| Node *& | getRoot () noexcept |
| Get reference to root pointer. | |
| Node * | getRoot () const noexcept |
| Get root pointer (const) | |
| void | verifyRedBlack () const |
| Verify red-black tree invariants (DEBUG mode). | |
| bool | verify () const noexcept |
| Verify tree is a valid red-black BST. | |
Private Member Functions | |
| void | restoreRedCondition (Node *p, Node *&fp, Node *ffp, Node *fffp) |
| Restore red-black condition after insertion. | |
| Node * | searchFlipColorsAndInsert (Node *q) noexcept |
| Search for insertion point with proactive color flipping. | |
| Node * | searchFlipColorsAndInsertDup (Node *q) noexcept |
| Like searchFlipColorsAndInsert but allows duplicate keys. | |
| Node * | searchAndBuildPath (const Key &key) noexcept |
| Search for key while building path stack. | |
| void | findSuccAndSwap (Node *p, Node *&fp) noexcept |
| Find successor and swap with node to delete. | |
| void | balanceDownAndColor (Node *p, Node *&fp, Node *&sp) noexcept |
| Balance down a violating black node. | |
| void | rotateNephewAndColor (Node *fp, Node *sp, Node *np) noexcept |
| Rotate nephew up and recolor to fix violation. | |
| void | doubleRotateNephewAndColor (Node *fp, Node *sp, Node *snp) noexcept |
| Double rotation and recolor to fix violation. | |
| void | removeAndFixBlackCondition (Node *q) 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. | |
| static void | blackHeight (Node *p, int &max, int bh=0) noexcept |
| Verify black height consistency. | |
| static void | testNode (Node *p) noexcept |
| Verify red condition and black height for a node. | |
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) | |
| FixedStack< Node * > | path {Node::MaxHeight} |
| Stack for deletion path. | |
| 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 83 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::Color = unsigned char |
Color type for red-black nodes.
Definition at line 87 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::key_type = Key |
The key type stored in nodes.
Definition at line 749 of file tpl_hRbTree.H.
| using Aleph::HtdRbTree< Key, Compare >::Node = RbNode<Key> |
The node type used by this tree.
Definition at line 90 of file tpl_hRbTree.H.
|
inlinenoexcept |
Default constructor.
Definition at line 764 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 Aleph::RLINK().
|
inlinenoexcept |
Move constructor.
Definition at line 788 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, Aleph::RLINK(), and Aleph::HtdRbTree< Key, Compare >::swap().
|
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) |
Definition at line 483 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::FixedStack< T >::is_empty(), Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::path, RED, Aleph::RLINK(), Aleph::rotate_to_left(), Aleph::rotate_to_right(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinestaticprivatenoexcept |
Verify black height consistency.
Recursively checks that all paths to leaves have the same number of black nodes.
| p | Node to check from |
| max | Current maximum black height (initialize to -1) |
| bh | Current black height count |
Definition at line 959 of file tpl_hRbTree.H.
References BLACK, Aleph::HtdRbTree< Key, Compare >::blackHeight(), COLOR, Aleph::LLINK(), Aleph::maps(), max(), RbNode< Key >::NullPtr, and Aleph::RLINK().
Referenced by Aleph::HtdRbTree< Key, Compare >::blackHeight(), and Aleph::HtdRbTree< Key, Compare >::testNode().
|
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 612 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::LLINK(), Aleph::maps(), RED, and Aleph::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 599 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::maps(), 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) |
Definition at line 563 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::FixedStack< T >::is_empty(), Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::path, RED, Aleph::RLINK(), Aleph::rotate_to_left(), Aleph::rotate_to_right(), and Aleph::FixedStack< T >::top().
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) |
Definition at line 400 of file tpl_hRbTree.H.
References COLOR, Aleph::LLINK(), log(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::path, Aleph::FixedStack< T >::push(), Aleph::RLINK(), Aleph::FixedStack< T >::size(), and Aleph::FixedStack< T >::top().
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 185 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::LLINK(), Aleph::maps(), RbNode< Key >::NullPtr, RED, and Aleph::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 761 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Alias for key_comp()
Definition at line 758 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Get root pointer (const)
Definition at line 947 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::root.
|
inlinenoexcept |
Get reference to root pointer.
Definition at line 944 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::root.
|
inlinestaticprivatenoexcept |
Returns sibling of p given its parent fp.
Definition at line 111 of file tpl_hRbTree.H.
References Aleph::LLINK(), Aleph::maps(), and Aleph::RLINK().
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) |
Definition at line 840 of file tpl_hRbTree.H.
References COLOR, Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::RLINK(), Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsert().
Referenced by Aleph::HtdRbTree< Key, Compare >::search_or_insert().
|
inlinenoexcept |
Insert allowing duplicate keys.
| p | Node to insert |
Definition at line 887 of file tpl_hRbTree.H.
References COLOR, Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::RLINK(), Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::searchFlipColorsAndInsertDup().
|
inlineconstexprnoexcept |
Check if tree is empty.
Definition at line 823 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 755 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
inlinenoexcept |
Returns a reference to the comparison functor.
Definition at line 752 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp.
|
delete |
Copy assignment deleted.
|
inlinenoexcept |
Move assignment.
Definition at line 807 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::swap().
|
inlinenoexcept |
Remove node with given key.
| key | Key to remove |
Definition at line 919 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, Aleph::FixedStack< T >::empty(), KEY, Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::path, 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) |
Definition at line 629 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::FixedStack< T >::empty(), Aleph::HtdRbTree< Key, Compare >::findSuccAndSwap(), Aleph::HtdRbTree< Key, Compare >::getSibling(), Aleph::LLINK(), Aleph::maps(), RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::path, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::popn(), RED, Aleph::RLINK(), Aleph::HtdRbTree< Key, Compare >::root, Aleph::HtdRbTree< Key, Compare >::rotateNephewAndColor(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::HtdRbTree< Key, Compare >::remove().
|
inlinenoexcept |
Reset tree (does not free nodes)
Definition at line 829 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 129 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::LLINK(), Aleph::maps(), RED, Aleph::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) |
Definition at line 529 of file tpl_hRbTree.H.
References BLACK, COLOR, Aleph::FixedStack< T >::is_empty(), Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::path, RED, Aleph::RLINK(), Aleph::rotate_to_left(), Aleph::rotate_to_right(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition().
|
inlinenoexcept |
Search for a key.
| key | Key to search for |
Definition at line 908 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, Aleph::maps(), 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 |
Definition at line 861 of file tpl_hRbTree.H.
References COLOR, Aleph::HtdRbTree< Key, Compare >::insert(), KEY, Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::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 |
Definition at line 345 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, Aleph::HtdRbTree< Key, Compare >::head, KEY, Aleph::LLINK(), log(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, Aleph::HtdRbTree< Key, Compare >::path, Aleph::FixedStack< T >::push(), Aleph::RLINK(), Aleph::HtdRbTree< Key, Compare >::root, and Aleph::FixedStack< T >::size().
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.
| q | Node to insert |
Definition at line 203 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, Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::HtdRbTree< Key, Compare >::restoreRedCondition(), Aleph::RLINK(), and Aleph::HtdRbTree< Key, Compare >::root.
Referenced by Aleph::HtdRbTree< Key, Compare >::insert().
|
inlineprivatenoexcept |
Like searchFlipColorsAndInsert but allows duplicate keys.
Definition at line 272 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, Aleph::LLINK(), Aleph::maps(), Aleph::HtdRbTree< Key, Compare >::node_count, RbNode< Key >::NullPtr, RED, Aleph::HtdRbTree< Key, Compare >::restoreRedCondition(), Aleph::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 826 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::node_count.
|
inlinenoexcept |
Swap contents with another tree.
Definition at line 780 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 >::HtdRbTree(), and Aleph::HtdRbTree< Key, Compare >::operator=().
|
inlinestaticprivatenoexcept |
Verify red condition and black height for a node.
Definition at line 982 of file tpl_hRbTree.H.
References BLACK, Aleph::HtdRbTree< Key, Compare >::blackHeight(), COLOR, Aleph::LLINK(), Aleph::maps(), max(), RED, and Aleph::RLINK().
Referenced by Aleph::HtdRbTree< Key, Compare >::verifyRedBlack().
|
inlinenoexcept |
Verify tree is a valid red-black BST.
Definition at line 1009 of file tpl_hRbTree.H.
References Aleph::HtdRbTree< Key, Compare >::cmp, is_red_black_bst(), and Aleph::HtdRbTree< Key, Compare >::root.
|
inline |
Verify red-black tree invariants (DEBUG mode).
Checks that each node satisfies red-black conditions. Aborts on violation.
Definition at line 1000 of file tpl_hRbTree.H.
References Aleph::preOrderRec(), Aleph::HtdRbTree< Key, Compare >::root, and Aleph::HtdRbTree< Key, Compare >::testNode().
|
private |
Comparison functor.
Definition at line 108 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 101 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 100 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 99 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 97 of file tpl_hRbTree.H.
|
private |
Auxiliary node, parent of root.
Definition at line 95 of file tpl_hRbTree.H.
|
private |
Auxiliary node, grandparent of root.
Definition at line 96 of file tpl_hRbTree.H.
|
private |
Number of nodes in tree.
Definition at line 106 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 |
Stack for deletion path.
Definition at line 104 of file tpl_hRbTree.H.
Referenced by Aleph::HtdRbTree< Key, Compare >::balanceDownAndColor(), Aleph::HtdRbTree< Key, Compare >::doubleRotateNephewAndColor(), Aleph::HtdRbTree< Key, Compare >::findSuccAndSwap(), Aleph::HtdRbTree< Key, Compare >::remove(), Aleph::HtdRbTree< Key, Compare >::removeAndFixBlackCondition(), Aleph::HtdRbTree< Key, Compare >::rotateNephewAndColor(), and Aleph::HtdRbTree< Key, Compare >::searchAndBuildPath().
|
private |
Reference to root (right child of head)
Definition at line 102 of file tpl_hRbTree.H.
Referenced by 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().