Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can not use copyHelper, buildHelper function and so on I just needed a .cpp file for these function please // Laboratory 8 ExpressionTree.h // //

can not use copyHelper, buildHelper function and so on

I just needed a .cpp file for these function please

// Laboratory 8 ExpressionTree.h // // Class declarations for the linked implementation of the // Expression Tree ADT -- including the recursive helpers for the // public member functions // // Instructor copy with the recursive helper function declarations. // The student version does not have those, but has a place to write // the declarations in the private section. // //--------------------------------------------------------------------

#ifndef EXPRESSIONTREE_H #define EXPRESSIONTREE_H

#include #include

using namespace std;

template class ExprTree { public:

// Constructor ExprTree (); ExprTree(const ExprTree& source);

ExprTree& operator=(const ExprTree& source);

// Destructor ~ExprTree ();

// Expression tree manipulation operations void build (); void expression () const; DataType evaluate() const throw (logic_error); void clear (); // Clear tree void commute(); bool isEquivalent(const ExprTree& source) const;

// Output the tree structure -- used in testing/debugging void showStructure () const;

private:

class ExprTreeNode { public: // Constructor ExprTreeNode ( char elem, ExprTreeNode *leftPtr, ExprTreeNode *rightPtr );

// Data members char dataItem; // Expression tree data item ExprTreeNode *left, // Pointer to the left child *right; // Pointer to the right child };

// Recursive helper functions for the public member functions -- insert // prototypes of these functions here.

// Data member ExprTreeNode *root; // Pointer to the root node };

#endif // #ifndef EXPRESSIONTREE_H

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago