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

Red-black tree with nodes without virtual destructor. More...

#include <tpl_rb_tree.H>

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

Public Types

using Base = Gen_Rb_Tree< RbNode, Key, Compare >
 
- Public Types inherited from Aleph::Gen_Rb_Tree< NodeType, Key, Compare >
using Node = NodeType< Key >
 
using key_type = Key
 
using compare_type = Compare
 

Additional Inherited Members

- Public Member Functions inherited from Aleph::Gen_Rb_Tree< NodeType, Key, Compare >
Compare & key_comp () noexcept
 Returns a reference to the comparison criteria.
 
const Compare & key_comp () const noexcept
 
Compare & get_compare () noexcept
 
const Compare & get_compare () const noexcept
 
 Gen_Rb_Tree (Compare __cmp=Compare()) noexcept
 Default constructor with optional comparator.
 
void swap (Gen_Rb_Tree &tree) noexcept
 Swaps all elements with another tree in constant time.
 
 Gen_Rb_Tree (Gen_Rb_Tree &&tree) noexcept
 Move constructor.
 
Gen_Rb_Treeoperator= (Gen_Rb_Tree &&tree) noexcept
 Move assignment operator.
 
virtual ~Gen_Rb_Tree ()=default
 Destructor.
 
Nodesearch (const Key &key) const noexcept
 Search for a key in the tree.
 
Node *& getRoot () noexcept
 Get reference to root pointer.
 
NodegetRoot () const noexcept
 Get const root pointer.
 
bool is_empty () const noexcept
 Returns true if the tree is empty.
 
size_t size () const noexcept
 Returns the number of nodes in the tree (O(1))
 
void reset () noexcept
 Reset tree to empty state (does not free nodes)
 
Nodeinsert (Node *p) noexcept
 Insert a node into the tree.
 
Nodesearch_or_insert (Node *p) noexcept
 Search for key or insert if not found.
 
Nodeinsert_dup (Node *p) noexcept
 Insert a node allowing duplicates.
 
bool verify () const noexcept
 Verify that tree satisfies red-black properties.
 
Noderemove (const Key &key) noexcept
 Remove the node containing key.
 

Detailed Description

template<typename Key, class Compare = Aleph::less<Key>>
struct Aleph::Rb_Tree< Key, Compare >

Red-black tree with nodes without virtual destructor.

Template Parameters
KeyKey type stored in tree nodes.
CompareComparison functor between keys.
See also
Rb_Tree_Vtl

Definition at line 682 of file tpl_rb_tree.H.

Member Typedef Documentation

◆ Base

template<typename Key , class Compare = Aleph::less<Key>>
using Aleph::Rb_Tree< Key, Compare >::Base = Gen_Rb_Tree<RbNode, Key, Compare>

Definition at line 684 of file tpl_rb_tree.H.


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