Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::inhstruct::BinTree Class Reference

#include <elm/inhstruct/BinTree.h>

+ Inheritance diagram for elm::inhstruct::BinTree:

Classes

class  Node
 
class  Visitor
 

Public Member Functions

 BinTree (void)
 
bool isEmpty (void) const
 
bool contains (Node *node)
 
int count (void) const
 
Noderoot (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)
 

Detailed Description

Provide a binary tree implementation. For being used, the pure virtual method compare() must be defined inan extended class.

Constructor & Destructor Documentation

elm::inhstruct::BinTree::BinTree ( void  )

Member Function Documentation

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.

Parameters
nodeNode to find.
Returns
True if the node is found, false else.
int elm::inhstruct::BinTree::count ( void  ) const

Count the number of nodes in the tree.

Returns
Count of nodes in the tree.

Referenced by elm::inhstruct::SortedBinTree::count().

void elm::inhstruct::BinTree::search ( Visitor visitor) const
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.

Parameters
visitorObject 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.

Parameters
visitorObject 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.

Parameters
visitorObject called for each node in the graph.

The documentation for this class was generated from the following files: