|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Hybrid RB tree with rank and virtual destructor. More...
#include <tpl_hRbTreeRk.H>
Public Types | |
| using | Base = HtdRbTreeRk< Key, Compare > |
| using | Node = typename Base::Node |
Public Types inherited from Aleph::HtdRbTreeRk< Key, Compare > | |
| using | Color = unsigned char |
| using | Node = RbNodeRk< Key > |
| using | key_type = Key |
Additional Inherited Members | |
Public Member Functions inherited from Aleph::HtdRbTreeRk< Key, Compare > | |
| Compare & | key_comp () noexcept |
| const Compare & | key_comp () const noexcept |
| Compare & | get_compare () noexcept |
| constexpr const Compare & | get_compare () const noexcept |
| HtdRbTreeRk () 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. | |
| HtdRbTreeRk (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 (HtdRbTreeRk &tree) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swaps in constant time the nodes and the comparison criteria of this and tree. | |
| HtdRbTreeRk (HtdRbTreeRk &&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. | |
| HtdRbTreeRk & | operator= (HtdRbTreeRk &&tree) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swaps the nodes and the comparison criteria with tree. | |
| HtdRbTreeRk (const HtdRbTreeRk &)=delete | |
| HtdRbTreeRk & | operator= (const HtdRbTreeRk &)=delete |
| virtual | ~HtdRbTreeRk ()=default |
| constexpr bool | is_empty () const noexcept |
| size_t | size () const noexcept |
| O(1) size using root count. | |
| void | reset () noexcept |
| 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 |
| Node * | getRoot () const noexcept |
| Node * | select (size_t i) const |
| Select the i-th smallest element (0-indexed). | |
| std::pair< long, Node * > | position (const Key &key) const noexcept(nothrow_compare_copy_v< Compare, Key >) |
| Find position of a key. | |
| std::pair< long, Node * > | find_position (const Key &key) const noexcept(nothrow_compare_copy_v< Compare, Key >) |
| Find position where key would be inserted. | |
| Node * | remove_pos (size_t i) |
| Remove element at position i. | |
| void | split_pos (size_t pos, HtdRbTreeRk &t1, HtdRbTreeRk &t2) |
| Split tree at position. | |
| bool | verify () const |
| Verify red-black and rank invariants. | |
Hybrid RB tree with rank and virtual destructor.
Definition at line 1141 of file tpl_hRbTreeRk.H.
| using Aleph::HtdRbTreeRkVtl< Key, Compare >::Base = HtdRbTreeRk<Key, Compare> |
Definition at line 1144 of file tpl_hRbTreeRk.H.
| using Aleph::HtdRbTreeRkVtl< Key, Compare >::Node = typename Base::Node |
Definition at line 1145 of file tpl_hRbTreeRk.H.