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

Top-down red-black tree without virtual destructor. More...

#include <tpl_tdRbTree.H>

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

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
 Default constructor.
 
 GenTdRbTree (const Compare &__cmp) noexcept
 Constructor with comparator.
 
 GenTdRbTree (GenTdRbTree &&other) noexcept
 Move constructor.
 
GenTdRbTreeoperator= (GenTdRbTree &&other) noexcept
 Move assignment operator.
 
 GenTdRbTree (const GenTdRbTree &)=delete
 Deleted copy constructor (use explicit copy if needed)
 
GenTdRbTreeoperator= (const GenTdRbTree &)=delete
 Deleted copy assignment.
 
void reset () noexcept
 Reset tree to empty state (does not free nodes)
 
void swap (GenTdRbTree &other) noexcept
 Swap contents with another tree.
 
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
 
Nodeinsert (Node *p) noexcept
 Insert a node into the tree.
 
Nodeinsert_dup (Node *p) noexcept
 Insert a node, allowing duplicates.
 
Nodesearch_or_insert (Node *p) noexcept
 Search for key or insert if not found.
 
Nodesearch (const Key &key) const noexcept
 Search for a key in the tree.
 
Noderemove (const Key &key) noexcept
 Remove and return node with given key.
 
Node *& getRoot () noexcept
 Get reference to root pointer.
 
NodegetRoot () const noexcept
 Get const root pointer

 
bool verifyRedBlack () const noexcept
 Verify that tree satisfies all red-black properties.
 
bool verify () const noexcept
 Alias for verify.
 

Detailed Description

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

Top-down red-black tree without virtual destructor.

Template Parameters
KeyThe type of keys stored in the tree.
CompareComparison functor (default: std::less<Key>).

Definition at line 891 of file tpl_tdRbTree.H.

Member Typedef Documentation

◆ Base

template<typename Key , class Compare = std::less<Key>>
using Aleph::TdRbTree< Key, Compare >::Base = GenTdRbTree<RbNode, Key, Compare>
private

Definition at line 893 of file tpl_tdRbTree.H.


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