Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::TdRbTreeRkVtl< Key, Compare > Class Template Reference

Top-down red-black tree with rank (virtual destructor). More...

#include <tpl_tdRbTreeRk.H>

Inheritance diagram for Aleph::TdRbTreeRkVtl< Key, Compare >:
[legend]
Collaboration diagram for Aleph::TdRbTreeRkVtl< Key, Compare >:
[legend]

Private Types

using Base = GenTdRbTreeRk< RbNodeRkVtl, Key, Compare >
 

Additional Inherited Members

- Public Types inherited from Aleph::GenTdRbTreeRk< NodeType, Key, Compare >
using Node = NodeType< Key >
 
using key_type = Key
 
using compare_type = Compare
 
- Public Member Functions inherited from Aleph::GenTdRbTreeRk< NodeType, Key, Compare >
 GenTdRbTreeRk () noexcept
 Default constructor.
 
 GenTdRbTreeRk (const Compare &__cmp) noexcept
 Constructor with comparator.
 
 GenTdRbTreeRk (GenTdRbTreeRk &&other) noexcept
 Move constructor.
 
GenTdRbTreeRkoperator= (GenTdRbTreeRk &&other) noexcept
 Move assignment.
 
 GenTdRbTreeRk (const GenTdRbTreeRk &)=delete
 
GenTdRbTreeRkoperator= (const GenTdRbTreeRk &)=delete
 
void reset () noexcept
 Reset tree (does not free nodes)
 
void swap (GenTdRbTreeRk &other) noexcept
 Swap with another tree.
 
virtual ~GenTdRbTreeRk ()=default
 
size_t size () const noexcept
 Get number of nodes O(1)
 
bool is_empty () const noexcept
 Check if empty.
 
Compare & get_compare () noexcept
 Get comparator.
 
const Compare & get_compare () const noexcept
 
Nodeinsert (Node *p) noexcept
 Insert a node.
 
Nodeinsert_dup (Node *p) noexcept
 Insert a node allowing duplicates.
 
Nodesearch_or_insert (Node *p) noexcept
 Search or insert.
 
Nodesearch (const Key &key) const noexcept
 Search for a key.
 
Noderemove (const Key &key) noexcept
 Remove node with given key.
 
Node *& getRoot () noexcept
 Get root pointer.
 
NodegetRoot () const noexcept
 
Nodeselect (size_t i) const
 Select i-th node in order.
 
std::pair< long, Node * > position (const Key &key) const noexcept
 Find position of a key.
 
std::pair< long, Node * > find_position (const Key &key) const noexcept
 Find position of a key (even if not in tree).
 
Noderemove_pos (size_t i)
 Remove node at position i.
 
void split_pos (size_t pos, GenTdRbTreeRk &t1, GenTdRbTreeRk &t2) noexcept
 Split tree by position.
 
bool verify () const noexcept
 Verify tree properties.
 

Detailed Description

template<typename Key, class Compare = std::less<Key>>
class Aleph::TdRbTreeRkVtl< Key, Compare >

Top-down red-black tree with rank (virtual destructor).

Template Parameters
KeyKey type.
CompareComparison functor.

Definition at line 994 of file tpl_tdRbTreeRk.H.

Member Typedef Documentation

◆ Base

template<typename Key , class Compare = std::less<Key>>
using Aleph::TdRbTreeRkVtl< Key, Compare >::Base = GenTdRbTreeRk<RbNodeRkVtl, Key, Compare>
private

Definition at line 996 of file tpl_tdRbTreeRk.H.


The documentation for this class was generated from the following file: