WinRAR
代码说明:
一个表达式和一个二叉树之间,存在着自然的对应关系。写一个程序,实现基于二叉树的表示的算术表达式Expression的操作。 基本要求 1.ReadExpr(E) 以字符序列的形式输入语法正确的前缀表示式并够着表达式E。 2.WriteExpr(E) 用带括弧的中缀表达式输出表达式E。 3.Assign(V,c) 实现对变量V的赋值(V=c),变量的初值为0。 4.Value(E) 对算术表达式E求值。 5.CompoundExpr(P,E1,E2) 构造一个新的复合表达式(E1)P(E2)。 (Between an expression and a binary tree, there is a natural correspondence relationship. Write a program to achieve the operation of the binary tree-based representation of the arithmetic expression Expression. The basic requirements for input grammatically correct prefix expressions 1.ReadExpr (E) in the form of a sequence of characters and enough with the expression E. 2.WriteExpr (E) output expression E infix expression with parentheses. 3.Assign (V, c) the assignment of the variable V (V = c), the initial value of the variable to 0. 4.Value (E) E evaluates arithmetic expressions. 5.CompoundExpr (P, E1, E2) to construct a new composite expressions (E1) P (E2).)
下载说明:请别用迅雷下载,失败请重下,重下不扣分!