#include <tree.h>
Inheritance diagram for tree< T >:
Public Types | |
typedef preorder_iterator | iterator |
Public Member Functions | |
tree () | |
constructor: empty tree doesn't exist, it's a one-node tree with no info. Be careful | |
tree (const T &) | |
constructor: one-node tree | |
tree (const tree< T > &) | |
copy constructor | |
tree (const preorder_iterator &) | |
~tree () | |
destructor | |
tree< T > & | operator= (const tree< T > &) |
assignment | |
unsigned int | num_children () const |
number of children | |
sibling_iterator | nth_child (unsigned int) const |
access nth child | |
void | append_child (const tree< T > &) |
append child to a tree | |
void | hang_child (tree< T > &) |
hang a tree as child of another (no copying!!) | |
void | clear () |
bool | empty () const |
detect empty tree | |
sibling_iterator | sibling_begin () |
begin/end sibling iterator | |
sibling_iterator | sibling_end () const |
preorder_iterator | begin () |
begin/end preorder iterator | |
preorder_iterator | end () const |
Public Attributes | |
T | info |
Private Member Functions | |
void | clone (const tree< T > &) |
clone an entire tree | |
Private Attributes | |
bool | isempty |
tree * | parent |
tree * | first |
tree * | last |
tree * | prev |
tree * | next |
Classes | |
class | generic_iterator |
class | preorder_iterator |
traverse the tree in preorder (parent first, then children) More... | |
class | sibling_iterator |
traverse all children of the same node More... |
|
|
|
constructor: empty tree doesn't exist, it's a one-node tree with no info. Be careful
|
|
constructor: one-node tree
|
|
copy constructor
|
|
|
|
destructor
|
|
append child to a tree
|
|
begin/end preorder iterator
|
|
|
|
clone an entire tree
|
|
detect empty tree
|
|
|
|
hang a tree as child of another (no copying!!)
|
|
access nth child
|
|
number of children
|
|
assignment
|
|
begin/end sibling iterator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|