![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/inhstruct/BinTree.h>
Inheritance diagram for BinTree: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().
Referenced by SortedBinTree::isEmpty(), and TreeBag< T, C, A >::isEmpty().
|
inline |
|
inline |
Referenced by TreeBag< T, C, A >::add(), Tree::insert(), SortedBinTree::insert(), Tree::remove(), and SortedBinTree::remove().
|
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. |