|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Generic postorder traversal of a binary tree. More...
#include <tpl_binNodeUtils.H>
Public Member Functions | |
| template<class Op > | |
| void | traverse (Node *root, Op &&op) const |
| Invoke the traversal. | |
| template<class Op > | |
| void | operator() (Node *root, Op &op) const |
| template<class Op > | |
| void | operator() (Node *root, Op &&op=Op()) const |
Static Private Member Functions | |
| template<class Op > | |
| static void | postorder (Node *root, Op &&op) |
Generic postorder traversal of a binary tree.
For_Each_Postorder traverses a binary tree in preorder. For each is node is called an operation with the following signature:
struct Op
{ void operator () (Node * p) { operation } };
Definition at line 343 of file tpl_binNodeUtils.H.
|
inline |
Definition at line 373 of file tpl_binNodeUtils.H.
References Aleph::For_Each_Postorder< Node >::postorder(), and root().
|
inline |
Definition at line 366 of file tpl_binNodeUtils.H.
References Aleph::For_Each_Postorder< Node >::postorder(), and root().
|
inlinestaticprivate |
Definition at line 346 of file tpl_binNodeUtils.H.
References Aleph::LLINK(), Aleph::For_Each_Postorder< Node >::postorder(), Aleph::RLINK(), and root().
Referenced by Aleph::For_Each_Postorder< Node >::operator()(), Aleph::For_Each_Postorder< Node >::operator()(), Aleph::For_Each_Postorder< Node >::postorder(), and Aleph::For_Each_Postorder< Node >::traverse().
|
inline |
Invoke the traversal.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 359 of file tpl_binNodeUtils.H.
References Aleph::For_Each_Postorder< Node >::postorder(), and root().