|
CPPX 3.2.1
A Modern C++ Utility Library
|
#include <cppx.h>
Public Member Functions | |
| 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 () |
| virtual int | height () const |
| int | count_leaves () const |
Protected Member Functions | |
| 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 | |
| Node< T > * | p_head = nullptr |
| NodePool< T > | m_pool |
|
default |
| stl_ext::BinaryTree< T >::BinaryTree | ( | const BinaryTree< T > & | other | ) |
Definition at line 119 of file binary_tree.tpp.
|
noexcept |
Definition at line 136 of file binary_tree.tpp.
|
virtual |
Definition at line 152 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::clear | ( | ) |
Definition at line 14 of file binary_tree.tpp.
Definition at line 62 of file binary_tree.tpp.
Definition at line 240 of file binary_tree.tpp.
| int stl_ext::BinaryTree< T >::count_leaves | ( | ) | const |
Definition at line 424 of file binary_tree.tpp.
Definition at line 44 of file binary_tree.tpp.
|
protected |
Definition at line 373 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::dump_to_dot | ( | const std::string & | filename | ) | const |
Definition at line 403 of file binary_tree.tpp.
Definition at line 260 of file binary_tree.tpp.
|
virtual |
Reimplemented in stl_ext::AVLTree< T >.
Definition at line 20 of file binary_tree.tpp.
Definition at line 175 of file binary_tree.tpp.
| bool stl_ext::BinaryTree< T >::is_empty | ( | ) | const |
Definition at line 274 of file binary_tree.tpp.
Definition at line 222 of file binary_tree.tpp.
Definition at line 333 of file binary_tree.tpp.
| Node< T > * stl_ext::BinaryTree< T >::make_node | ( | const T & | val, |
| Node< T > * | left, | ||
| Node< T > * | right | ||
| ) |
Definition at line 338 of file binary_tree.tpp.
|
noexcept |
Definition at line 141 of file binary_tree.tpp.
| BinaryTree< T > & stl_ext::BinaryTree< T >::operator= | ( | const BinaryTree< T > & | other | ) |
Definition at line 124 of file binary_tree.tpp.
Definition at line 193 of file binary_tree.tpp.
Definition at line 157 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::print_inorder | ( | ) | const |
Definition at line 317 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::print_levelorder | ( | ) | const |
Definition at line 327 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::print_postorder | ( | ) | const |
Definition at line 322 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::print_preorder | ( | ) | const |
Definition at line 312 of file binary_tree.tpp.
| void stl_ext::BinaryTree< T >::print_tree | ( | ) | const |
Definition at line 356 of file binary_tree.tpp.
|
protected |
Definition at line 344 of file binary_tree.tpp.
Definition at line 284 of file binary_tree.tpp.
Definition at line 298 of file binary_tree.tpp.
Definition at line 265 of file binary_tree.tpp.
| int stl_ext::BinaryTree< T >::size | ( | ) | const |
Definition at line 279 of file binary_tree.tpp.