// MAryTree.cpp #include #include ///////////////////////////////////////////////////////////// // class Node - holds the M-Ary tree's data template class Node { public: Node(const T& t); void addChild(Node* pNode); bool nextChild(Node& n); unsigned int size(); private: std::vector _children; }; ///////////////////////////////////////////////////////////// // class Proc // interface for processing to be applied to each node class Proc { public: virtual ~Proc() {} virtual void processNode()=0; }; ///////////////////////////////////////////////////////////// // class MAryTree // holds onto head node, knows how to search // and how to process each node template class MAryTree { public: MAryTree(); ~MAryTree(); MAryTree(const MAryTree& m); MAryTree& operator=(const MAryTree& m); void add(Node& parent, const T& t); // wraps t in Node void DFS(Proc& p); bool find(T& t); private: Node* head; }; int main() { std::cout << "\n no member functions implemented\n\n"; }