name: Tree<TObject>

synopsis:


g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_dstr_a

#include <Tree.h>

TreeNode<TObject>* getRoot() const;
TreeNode<TObject>* insert(TObject* obj);
boolean insertChild(TreeNode<TObject>* pnode, TreeNode<TObject>* cnode);
boolean remove();
boolean remove(TObject*& obj);
boolean find(const TObject* obj);
boolean find(const TreeNode<TObject>* node);
boolean contains(const TObject* obj) const;
boolean contains(const TreeNode<TObject>* node) const;
boolean get(Vector<Ulong>& root_adj, SingleLinkedList<TObject>& node_obj, SingleLinkedList<Vector<Ulong> >& node_adj);
boolean set(Vector<Ulong>& root_adj, SingleLinkedList<TObject>& node_obj, SingleLinkedList<Vector<Ulong> >& node_adj);
DstrBase::ALLOCATION getAllocationMode() const;
boolean setAllocationMode(DstrBase::ALLOCATION alloc);
boolean postorderTreeTraversal(SingleLinkedList<TreeNode<TObject> >& arg);
boolean preorderTreeTraversal(SingleLinkedList<TreeNode<TObject> >& arg);
boolean inorderTreeTraversal(SingleLinkedList<TreeNode<TObject> >& arg);
boolean levelorderTreeTraversal(SingleLinkedList<TreeNode<TObject> >& arg);

quick start:


Char* char_a = new Char('a');
Char* char_b = new Char('b');

Tree<Char> tree_00;

tree_00.insertChild(tree_00.getRoot(), tree_00.insert(char_a));
tree_00.insertChild(tree_00.getRoot(), tree_00.insert(char_b));

delete char_a;
delete char_b;

description:

This class implements a generic Tree data structure using the left child right sibling representation. this class uses the double linked list class in USER mode since this list is used to store either the actual data or a pointer to it.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

notes: