Introduction - If you have any usage issues, please Google them yourself
Between an expression and a binary tree, there is a natural correspondence. Write a program to realize the arithmetic expression based on Binary Tree for Expression of the operation.
Basic requirements of】 【
【1】 【will do some】
Suppose an arithmetic expression can contain variables in Expression (az), constant (0-9) and the binary operator (+,-,*,/,^( power)). To achieve the following:
(1) ReadExpr (E)- in the form of a sequence of characters enter the correct prefix expression syntax and constructs the expression E.
(2) WriteExpr (E)- with the infix expression with parentheses output expression E.
(3) Assign (V, c)- to achieve the assignment of the variable V (V = c), the variable s initial value is 0.
(4) Value (E)- E evaluation of arithmetic expressions.
(5) CompoundExpr (p, E1, E2)- construct a new complex expression (E1) p (E2).
【2】 【choose to do some】
(1) the original written form of expression input, support for constant positive integer greater than 0
(2)