bubble v0.0.1
|
Class for AVL tree. More...
#include <avl_tree.h>
Classes | |
class | Iterator |
Iterator class. More... | |
Public Member Functions | |
avl_tree (std::vector< T > _elements={}) noexcept | |
Contructor for AVL tree class. | |
avl_tree (const avl_tree &a) noexcept | |
Copy constructor for avl tree class. | |
avl_tree & | operator= (const avl_tree &a) noexcept |
operator = for avl tree class | |
~avl_tree () noexcept | |
Destroy the avl tree object. | |
void | insert (T key) |
insert function. | |
void | clear () |
clear function Erase all the nodes from the tree. | |
T | get_root () const |
get_root function | |
bool | search (T key) |
search function. | |
Iterator | begin () |
pointer that points to begin | |
Iterator | end () |
pointer that points to end | |
size_t | size () const |
size function | |
void | remove (T key) |
remove function. | |
std::vector< T > | inorder () const |
inorder function. | |
std::vector< T > | preorder () const |
preorder function. | |
std::vector< T > | postorder () const |
postorder function. | |
std::vector< std::vector< T > > | level_order () |
level order function. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, avl_tree< T > &t) |
operator << for avl_tree class | |
Class for AVL tree.
|
inlineexplicitnoexcept |
Contructor for AVL tree class.
__elements | you can directly pass a vector<T> so you don't have to do insert multiple times. |
|
inlineexplicitnoexcept |
Copy constructor for avl tree class.
a | the tree we want to copy |
pointer that points to begin
pointer that points to end
|
inline |
get_root function
|
inline |
inorder function.
|
inline |
insert function.
key | key to be inserted. |
|
inline |
level order function.
|
inline |
postorder function.
|
inline |
preorder function.
|
inline |
remove function.
key | key to be removed. |
|
inline |
search function.
key | key to be searched. |
|
inline |
size function