class ExpTreeNode{ public: // kinds of nodes which can occur. the net effect of // this declaration is to define a bunch of constants. enum nodeType { PLUS = 0, MINUS = 1, MULTIPLY = 2, DIVIDE = 3, NUMBER = 4, UNDEFINED = 5 }; nodeType type; int value; // only used when “type” == NUMBER ExpTreeNode *left, *right; // note: the second argument is optional ExpTreeNode (nodeType type, int value = 1) { ExpTreeNode::type = type; ExpTreeNode::value = value; // harmless at worst left = right = NULL; // guarantee reasonable values } }; void deleteExpTree(ExpTreeNode *root); int evaluateExpTree(ExpTreeNode *root); void outputInfixExpression (ExpTreeNode *root); void outputPostfixExpression (ExpTreeNode *root); // outputs an error message and returns null if the String2002 object // is not a valid expression ExpTreeNode *createExpTree (String2002 str);