CPPX 3.2.1
A Modern C++ Utility Library
Loading...
Searching...
No Matches
stl_ext::AVLTree< T > Class Template Reference

#include <cppx.h>

Inheritance diagram for stl_ext::AVLTree< T >:
Collaboration diagram for stl_ext::AVLTree< T >:

Public Member Functions

void insert (const T &val) override
 
void remove (const T &val) override
 
int height () const override
 
- Public Member Functions inherited from stl_ext::BST< T >
bool contains (const T &val) const
 
T get_min () const
 
T get_max () const
 
T get_successor (const T &val) const
 
T get_predecessor (const T &val) const
 
- Public Member Functions inherited from stl_ext::BinaryTree< T >
 BinaryTree ()=default
 
 BinaryTree (const BinaryTree &other)
 
BinaryTree & operator= (const BinaryTree &other)
 
 BinaryTree (BinaryTree &&other) noexcept
 
BinaryTree & operator= (BinaryTree &&other) noexcept
 
virtual ~BinaryTree ()
 
Node< T > * get_root () const
 
void set_root (Node< T > *root)
 
bool is_empty () const
 
int size () const
 
void print_preorder () const
 
void print_inorder () const
 
void print_postorder () const
 
void print_levelorder () const
 
void print_tree () const
 
void dump_to_dot (const std::string &filename) const
 
Node< T > * make_node (const T &val)
 
Node< T > * make_node (const T &val, Node< T > *left, Node< T > *right)
 
void set_left (Node< T > *parent, Node< T > *left_child)
 
void set_right (Node< T > *parent, Node< T > *right_child)
 
void clear ()
 
int count_leaves () const
 

Additional Inherited Members

- Protected Member Functions inherited from stl_ext::BinaryTree< T >
void preorder (const Node< T > *node) const
 
void inorder (const Node< T > *node) const
 
void postorder (const Node< T > *node) const
 
void levelorder (const Node< T > *node) const
 
int compute_size (const Node< T > *node) const
 
void print_tree_helper (const Node< T > *node, const std::string &prefix, bool is_left) const
 
void dot_helper (const Node< T > *node, std::ostream &out, int &null_count) const
 
void destroy_subtree (Node< T > *node)
 
Node< T > * clone_subtree (const Node< T > *node)
 
- Protected Attributes inherited from stl_ext::BinaryTree< T >
Node< T > * p_head = nullptr
 
NodePool< T > m_pool
 

Detailed Description

template<typename T>
class stl_ext::AVLTree< T >

Definition at line 158 of file cppx.h.

Member Function Documentation

◆ height()

template<typename T >
int stl_ext::AVLTree< T >::height ( ) const
overridevirtual

Reimplemented from stl_ext::BinaryTree< T >.

Definition at line 167 of file avl.tpp.

◆ insert()

template<typename T >
void stl_ext::AVLTree< T >::insert ( const T &  val)
overridevirtual

Reimplemented from stl_ext::BST< T >.

Definition at line 71 of file avl.tpp.

◆ remove()

template<typename T >
void stl_ext::AVLTree< T >::remove ( const T &  val)
overridevirtual

Reimplemented from stl_ext::BST< T >.

Definition at line 101 of file avl.tpp.


The documentation for this class was generated from the following files: