|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Top-down red-black tree without virtual destructor. More...
#include <tpl_tdRbTree.H>
Private Types | |
| using | Base = GenTdRbTree< RbNode, Key, Compare > |
Additional Inherited Members | |
Public Types inherited from Aleph::GenTdRbTree< NodeType, Key, Compare > | |
| using | Node = NodeType< Key > |
| using | key_type = Key |
| using | compare_type = Compare |
Public Member Functions inherited from Aleph::GenTdRbTree< NodeType, Key, Compare > | |
| 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. | |
Top-down red-black tree without virtual destructor.
| Key | The type of keys stored in the tree. |
| Compare | Comparison functor (default: Aleph::less<Key>). |
Definition at line 945 of file tpl_tdRbTree.H.
|
private |
Definition at line 947 of file tpl_tdRbTree.H.