|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Hybrid red-black tree with virtual node destructor. More...
#include <tpl_hRbTree.H>
Public Types | |
| using | Base = HtdRbTree< Key, Compare > |
| using | Node = typename Base::Node |
Public Types inherited from Aleph::HtdRbTree< Key, Compare > | |
| 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. | |
Additional Inherited Members | |
Public Member Functions inherited from Aleph::HtdRbTree< Key, Compare > | |
| 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. | |
Hybrid red-black tree with virtual node destructor.
Same as HtdRbTree but uses RbNodeVtl which has virtual destructor.
Definition at line 1031 of file tpl_hRbTree.H.
| using Aleph::HtdRbTreeVtl< Key, Compare >::Base = HtdRbTree<Key, Compare> |
Definition at line 1034 of file tpl_hRbTree.H.
| using Aleph::HtdRbTreeVtl< Key, Compare >::Node = typename Base::Node |
Definition at line 1035 of file tpl_hRbTree.H.