datastructures 0.1.0
Loading...
Searching...
No Matches
datastructures::detail::avl_node< TItem, TAlloc > Struct Template Reference

AVL Tree Node. More...

#include <_avl.hpp>

Public Attributes

TItem item
 The key / key, value pair.
 
avl_sign_type sign = 0
 Determines whether the node is leaning to one side or balanced.
 
avl_node_ptr< avl_node, TAlloc > parent = nullptr
 The parent node.
 
avl_node_ptr< avl_node, TAlloc > left = nullptr
 The left sub-tree.
 
avl_node_ptr< avl_node, TAlloc > right = nullptr
 The right sub-tree.
 

Detailed Description

template<class TItem, class TAlloc>
struct datastructures::detail::avl_node< TItem, TAlloc >

AVL Tree Node.

A tree node that stores an item of a given type, its parent and children and the sign.

Template Parameters
TItemThe item type, usually the const key_type or std::pair<const key_type, value_type>.
TAllocAllocator type to rebind the node allocator from, should be the item allocator.

Member Data Documentation

◆ item

template<class TItem , class TAlloc >
TItem datastructures::detail::avl_node< TItem, TAlloc >::item

The key / key, value pair.

◆ left

template<class TItem , class TAlloc >
avl_node_ptr<avl_node, TAlloc> datastructures::detail::avl_node< TItem, TAlloc >::left = nullptr

The left sub-tree.

◆ parent

template<class TItem , class TAlloc >
avl_node_ptr<avl_node, TAlloc> datastructures::detail::avl_node< TItem, TAlloc >::parent = nullptr

The parent node.

It is always true that either parent->left = this or parent->right = this.

◆ right

template<class TItem , class TAlloc >
avl_node_ptr<avl_node, TAlloc> datastructures::detail::avl_node< TItem, TAlloc >::right = nullptr

The right sub-tree.

◆ sign

template<class TItem , class TAlloc >
avl_sign_type datastructures::detail::avl_node< TItem, TAlloc >::sign = 0

Determines whether the node is leaning to one side or balanced.

It is defined the following way: sign := height(right) - height(left).


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