|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
AVL binary search tree with nodes without virtual destructor. More...
#include <tpl_avl.H>
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 Node * | getRoot () const noexcept |
| Return a modifiable reference to tree's root. | |
| Node * | search (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. | |
| Node * | insert (Node *p) noexcept |
Insert the node pointed by p in the tree. | |
| Node * | search_or_insert (Node *p) noexcept |
| Search or insert a key. | |
| Node * | insert_dup (Node *p) noexcept |
Insert the node p without testing for key duplicity. | |
| Node * | remove (const Key &key) noexcept |
Remove from an AVL tree the node containing key key. | |
| bool | verify () const noexcept |
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.
| Key | the key type stored in the tree nodes. |
| Compare | key comparison class; by default, this is the less-than relational operator for type Key. |
| using Aleph::Avl_Tree< Key, Compare >::Base = Gen_Avl_Tree<AvlNode, Key, Compare> |