Prog04 - void remove_first(); // Remove first child void...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// General tree node ADT template <class Elem> class GTNode { public: GTNode(const Elem&); // Constructor ~GTNode(); // Destructor Elem value(); // Return node's value bool isLeaf(); // TRUE if node is a leaf GTNode* parent(); // Return parent GTNode* leftmost_child(); // Return first child GTNode* right_sibling(); // Return right sibling void setValue(Elem&); // Set node's value void insert_first(GTNode<Elem>* n); // Insert first child void insert_next(GTNode<Elem>* n); // Insert next sibling
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: void remove_first(); // Remove first child void remove_next(); // Remove right sibling }; // General tree ADT template &lt;class Elem&gt; class GenTree { private: void printhelp(GTNode*); // Print helper function public: GenTree(); // Constructor ~GenTree(); // Destructor void clear(); // Send nodes to free store GTNode* root(); // Return the root // Combine two subtrees void newroot(Elem&amp;, GTNode&lt;Elem&gt;*, GTNode&lt;Elem&gt;*); void print(); // Print a tree };...
View Full Document

This note was uploaded on 01/19/2010 for the course CSC 375 taught by Professor Turner during the Spring '09 term at University of Michigan-Dearborn.

Ask a homework question - tutors are online