55 virtual int which(
tree *branch_to_find)
const;
70 virtual int depth()
const;
76 virtual void insert(
int branch_place,
tree *new_branch);
140 bool next_node(
tree *&to_return);
Outcomes describe the state of completion for an operation.
An object representing the interstitial cell in most linked data structures.
A method for tracing a route from a tree's root to a particular node.
void whack(tree *to_whack)
destroys the tree "to_whack".
tree * next()
Returns a pointer to the next tree in the direction of traversal.
iterator(const tree *initial, traversal_directions direction)
traversal_directions _order
A dynamically linked tree with an arbitrary number of branches.
virtual int depth() const
Returns the distance of "this" from the root. The root's depth is 0.
virtual void insert(int branch_place, tree *new_branch)
inserts "new_branch" before the branches starting at "branch_place".
virtual basis::outcome prune_index(int branch_to_cut)
Removes the branch at the specified index from this tree.
virtual int which(tree *branch_to_find) const
Returns the branch number for a particular branch in this tree.
virtual ~tree()
destroys the tree by recursively destroying all child tree nodes.
tree()
constructs a new tree with a root and zero branches.
DEFINE_CLASS_NAME("tree")
virtual int branches() const
Returns the number of branches currently connected to this tree.
virtual void attach(tree *new_branch)
Attaches the specified branch to the current tree.
virtual basis::outcome prune(tree *branch_to_cut)
Removes the specified branch from this tree.
virtual tree * parent() const
Returns the tree node that is the immediate ancestor of this one.
iterator start(traversal_directions direction) const
Returns a fresh iterator positioned at this tree node.
virtual bool generate_path(path &to_follow) const
Returns the path to "this" path_tree from its root.
virtual tree * root() const
Locates and returns the absolute root of the tree containing this tree.
virtual tree * branch(int branch_number) const
Returns the specified branch of this tree.