![]() |
Libftpp
A modern C++ library
|
N ary Tree class. More...
#include <n_ary_tree.hpp>
Public Member Functions | |
| NAryTree () | |
| Node< TType > * | setRoot (TType value) |
| Node< TType > * | getRoot () const |
| Node< TType > * | addChild (Node< TType > *parent, const TType &value) |
| Node< TType > * | addChildToRoot (const TType &value) |
| void | preorder (std::function< void(TType)> &funct) |
| Traverse the tree in preorder (parent → children). More... | |
| void | preorder (Node< TType > *node, std::function< void(TType)> &funct) |
| std::vector< TType > | preorderValues () |
| void | preorder (Node< TType > *node, std::vector< TType > &result) |
| void | postorder (std::function< void(TType)> &funct) |
| Traverse the tree in postorder (children → parent). More... | |
| void | postorder (Node< TType > *node, std::function< void(TType)> &funct) |
| std::vector< TType > | postorderValues () |
| void | postorder (Node< TType > *node, std::vector< TType > &result) |
| template<typename TResult > | |
| TResult | postorderCompute (Node< TType > *node) |
N ary Tree class.
Definition at line 90 of file n_ary_tree.hpp.
Definition at line 96 of file n_ary_tree.hpp.
|
inline |
Definition at line 109 of file n_ary_tree.hpp.
References Node< TType >::_children.
Referenced by NAryTree< TType >::addChildToRoot().
|
inline |
Definition at line 117 of file n_ary_tree.hpp.
References NAryTree< TType >::addChild().
Definition at line 104 of file n_ary_tree.hpp.
|
inline |
Definition at line 170 of file n_ary_tree.hpp.
References Node< TType >::_children, Node< TType >::data, and NAryTree< TType >::postorder().
|
inline |
Definition at line 189 of file n_ary_tree.hpp.
References Node< TType >::_children, Node< TType >::data, and NAryTree< TType >::postorder().
|
inline |
Traverse the tree in postorder (children → parent).
| funct | Function applied to each node's value |
Definition at line 164 of file n_ary_tree.hpp.
Referenced by NAryTree< TType >::postorder(), and NAryTree< TType >::postorderValues().
|
inline |
Definition at line 201 of file n_ary_tree.hpp.
References Node< TType >::_children, Node< TType >::data, and Node< TType >::parentFunct.
|
inline |
Definition at line 182 of file n_ary_tree.hpp.
References NAryTree< TType >::postorder().
|
inline |
Definition at line 132 of file n_ary_tree.hpp.
References Node< TType >::_children, Node< TType >::data, and NAryTree< TType >::preorder().
|
inline |
Definition at line 151 of file n_ary_tree.hpp.
References Node< TType >::_children, Node< TType >::data, and NAryTree< TType >::preorder().
|
inline |
Traverse the tree in preorder (parent → children).
| funct | Function applied to each node's value |
Definition at line 126 of file n_ary_tree.hpp.
Referenced by NAryTree< TType >::preorder(), and NAryTree< TType >::preorderValues().
|
inline |
Definition at line 144 of file n_ary_tree.hpp.
References NAryTree< TType >::preorder().
Definition at line 97 of file n_ary_tree.hpp.