Elm
1.0
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.
elm::inhstruct::BinTree::BinTree | ( | void | ) |
void elm::inhstruct::BinTree::clear | ( | void | ) |
Remove all nodes from the tree.
Referenced by elm::inhstruct::SortedBinTree::clear().
bool elm::inhstruct::BinTree::contains | ( | Node * | node | ) |
Check if node if the node is contained in the tree.
node | Node to find. |
int elm::inhstruct::BinTree::count | ( | void | ) | const |
Count the number of nodes in the tree.
Referenced by elm::inhstruct::SortedBinTree::count().
bool elm::inhstruct::BinTree::isEmpty | ( | void | ) | const |
BinTree::Node * elm::inhstruct::BinTree::root | ( | void | ) | const |
Referenced by elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::add(), elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::clear(), elm::inhstruct::SortedBinTree::get(), elm::inhstruct::SortedBinTree::insert(), elm::genstruct::GenSortedBinTree< T, K, C >::Iterator::Iterator(), elm::inhstruct::SortedBinTree::remove(), and elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::remove().
void elm::inhstruct::BinTree::search | ( | Visitor * | visitor | ) | const |
void elm::inhstruct::BinTree::setRoot | ( | BinTree::Node * | node | ) |
void elm::inhstruct::BinTree::visit | ( | BinTree::Visitor * | visitor | ) | const |
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. |
void elm::inhstruct::BinTree::visitPostOrder | ( | BinTree::Visitor * | visitor | ) | const |
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. |
void elm::inhstruct::BinTree::visitPreOrder | ( | BinTree::Visitor * | visitor | ) | const |
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. |