Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/inhstruct/BinTree.h>
Classes | |
class | Node |
class | Visitor |
Public Member Functions | |
BinTree (void) | |
bool | isEmpty (void) const |
bool | contains (Node *node) |
int | count (void) const |
Node * | root (void) const |
void | setRoot (Node *node) |
void | visit (Visitor *visitor) const |
void | visitPreOrder (Visitor *visitor) const |
void | visitPostOrder (Visitor *visitor) const |
void | search (Visitor *visitor) const |
void | clear (void) |
Provide a binary tree implementation. For being used, the pure virtual method compare() must be defined inan extended class.
Remove all nodes from the tree.
Referenced by SortedBinTree::clear().
Check if node if the node is contained in the tree.
node | Node to find. |
|
inline |
Count the number of nodes in the tree.
Referenced by SortedBinTree::count().
|
inline |
Referenced by TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::add(), TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::clear(), TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::find(), SortedBinTree::get(), SortedBinTree::insert(), TreeBag< T, C, A >::Iter::Iter(), SortedBinTree::remove(), and TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::remove().
|
inline |
|
inline |
Visit the tree in-order, that is, the left sub-tree, the root node and the right sub-tree.
visitor | Object called for each node in the graph. |
|
inline |
Visit the tree in post-order, that is, the left sub-tree and then, right sub-tree and the root node.
visitor | Object called for each node in the graph. |
|
inline |
Visit the tree in pre-order, that is, visit node, the left sub-tree and then the right sub-tree.
visitor | Object called for each node in the graph. |