General implementation of the Red-Black self-balancing binary tree. More...
#include <di/container/tree/rb_tree.h>
Classes | |
struct | InsertPosition |
Public Member Functions | |
RBTree ()=default | |
RBTree (RBTree const &)=delete | |
auto | operator= (RBTree const &) -> RBTree &=delete |
constexpr | RBTree (Comp comparator) |
constexpr | RBTree (RBTree &&other) |
constexpr auto | operator= (RBTree &&other) -> RBTree & |
constexpr | ~RBTree () |
constexpr auto | size () const -> usize |
constexpr auto | empty () const -> bool |
constexpr auto | begin () -> Iterator |
constexpr auto | begin () const -> ConstIterator |
constexpr auto | end () -> Iterator |
constexpr auto | end () const -> ConstIterator |
constexpr auto | unconst_iterator (ConstIterator it) -> Iterator |
constexpr auto | insert_node (Node &node) |
constexpr auto | insert_node (ConstIterator, Node &node) |
constexpr auto | erase_impl (ConstIterator position) -> Iterator |
template<typename U> requires (concepts::StrictWeakOrder<Comp&, Value, U>) | |
constexpr auto | equal_range_impl (U &&needle) const |
template<typename U> requires (concepts::StrictWeakOrder<Comp&, Value, U>) | |
constexpr auto | lower_bound_impl (U &&needle) const -> ConstIterator |
template<typename U> requires (concepts::StrictWeakOrder<Comp&, Value, U>) | |
constexpr auto | upper_bound_impl (U &&needle) const -> ConstIterator |
template<typename U> requires (concepts::StrictWeakOrder<Comp&, Value, U>) | |
constexpr auto | find_impl (U &&needle) const -> ConstIterator |
constexpr void | merge_impl (RBTree &&other) |
Protected Member Functions | |
constexpr auto | node_value (Node &node) const -> Value & |
constexpr auto | node_value (Node const &node) const -> Value const & |
constexpr auto | node_color (Node *node) const -> Node::Color |
constexpr void | rotate_left (Node &x) |
constexpr void | rotate_right (Node &y) |
template<typename U> requires (concepts::StrictWeakOrder<Comp&, Value, U>) | |
constexpr auto | insert_position (U &&needle) const -> InsertPosition |
constexpr void | insert_node (InsertPosition position, Node &to_insert) |
constexpr void | do_insert_node (InsertPosition position, Node &to_insert) |
constexpr void | do_insert_rebalancing (Node *node) |
constexpr void | transplant (Node &u, Node *v) |
constexpr void | erase_node (Node &to_delete) |
constexpr void | do_erase_rebalancing (Node *x) |
constexpr auto | compare (Node const &a, Node const &b) const |
template<typename T, typename U> requires (concepts::StrictWeakOrder<Comp&, T, U>) | |
constexpr auto | compare (T const &a, U &&b) const |
Protected Attributes | |
Node * | m_root { nullptr } |
Node * | m_minimum { nullptr } |
Node * | m_maximum { nullptr } |
usize | m_size { 0 } |
Comp | m_comparator |
Friends | |
constexpr friend auto | operator== (ConcreteSelf const &a, ConcreteSelf const &b) -> bool requires(concepts::EqualityComparable< Value >) |
constexpr friend auto | operator<=> (ConcreteSelf const &a, ConcreteSelf const &b) |
General implementation of the Red-Black self-balancing binary tree.
The book Introduction to Algorithms, Third Edition (by Thomas H. Cormen, et al.) was heavily referenced in this class's implementation of a Red-Black tree. See here.
|
default |
|
delete |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
delete |
|
inlineconstexprprotected |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexprprotected |
|
inlineconstexpr |
|
inlineconstexpr |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |