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

AVL binary search tree with nodes without virtual destructor. More...

#include <tpl_avl.H>

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

Public Types

using Base = Gen_Avl_Tree< AvlNode, Key, Compare >
 
- Public Types inherited from Aleph::Gen_Avl_Tree< NodeType, Key, Compare >
using Node = NodeType< Key >
 
using key_type = Key
 

Additional Inherited Members

- Public Member Functions inherited from Aleph::Gen_Avl_Tree< NodeType, Key, Compare >
constexpr Compare & key_comp () noexcept
 The key type.
 
constexpr Compare & get_compare () noexcept
 
 Gen_Avl_Tree (Compare __cmp=Compare()) noexcept
 
void swap (Gen_Avl_Tree &tree) noexcept
 Swap in constant time all the items of this with the items of tree.
 
virtual ~Gen_Avl_Tree () noexcept
 
constexpr Node *& getRoot () noexcept
 Return a modifiable reference to tree's root.
 
constexpr NodegetRoot () const noexcept
 Return a modifiable reference to tree's root.
 
Nodesearch (const Key &key) const noexcept
 Search a node containing key; if found, then a pointer to the node containing it is returned; otherwise nullptr is returned.
 
Nodeinsert (Node *p) noexcept
 Insert the node pointed by p in the tree.
 
Nodesearch_or_insert (Node *p) noexcept
 Search or insert a key.
 
Nodeinsert_dup (Node *p) noexcept
 Insert the node p without testing for key duplicity.
 
Noderemove (const Key &key) noexcept
 Remove from an AVL tree the node containing key key.
 
bool verify () const noexcept
 

Detailed Description

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

AVL binary search tree with nodes without virtual destructor.

An AVL binary search tree is a binary search tree whose height is bounded by \(O(\lg n)\) and whose update operations are bounded in time by inspecting \(O(\lg n)\) nodes.

This class uses nodes without a virtual destructor.

Parameters
Keythe key type stored in the tree nodes.
Comparekey comparison class; by default, this is the less-than relational operator for type Key.
See also
Avl_Tree_Vtl

Definition at line 703 of file tpl_avl.H.

Member Typedef Documentation

◆ Base

template<typename Key , class Compare = Aleph::less<Key>>
using Aleph::Avl_Tree< Key, Compare >::Base = Gen_Avl_Tree<AvlNode, Key, Compare>

Definition at line 705 of file tpl_avl.H.


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