算术表达式求值演示系统--数据结构作业!-arithmetic expression evaluates demonstration system -- operational data structure! 下载
|
按照《数据结构习题集》严蔚敏版的实验2.5做的算术表达式求值演示。-accordance with the "data structure Exercises Set" Yan Wei-min 2.5 version of the experiment do the arithmetic expression evaluates demonstration. 下载
|
编制一个算术表达式求值的程序 1)以字符序列的形式从终端输入表达式,实现对运算表达式的求值。 (2)演示在求值中运算符栈,运算数栈、输入字符和主要操作的变化过程。 (3)设置运算符栈和运算数栈辅助分析算符优先关系。 (4)在读入表达式的字符序列的同时,完成运算符和运算数的识别处理,以及 相应的运算。 (5)在识别出运算数的同时,要将其字符序列形式转换成整数形式。 -compiled an arithmetic expression for a value of the procedure) to form the sequence of characters from the terminal input expression, Operators achieve expression of the value. (2) demonstration at the University of value Operators stack, operand stack, and the main characters in the importation of the process of change operation. (3) The provision of Operators and operand stack Stack aided analysis operator precedence relations. (4) read into the expression of the sequence of characters, complete Operators and operands identification, and the corresponding operation. (5) identified several operations at the same time, his sequence of characters forms into integer form. 下载
|
表达式类型的实现 1. 算术表达式的合法输入数据包括变量(A~Z,a~z)、常量(0-9)和二元运算符(+,-,*,/,^(乘幂))。程序对数据输入格式不作要求,用户需自己保证语法正确,详见用户手册说明。 2. 演示程序以人机对话的方式执行,即在计算机上显示提示信息后,由用户在键盘上输入对应的数据或命令,程序将执行相应的操作并显示下一步信息。 3. 程序执行的命令包括: 1) 根据用户输入的前缀表达式自动添加括号并建立其自然书写形式的表达式; 2)提示用户给各变量赋值; 3)建立二叉树,并基于二叉树进行求值运算,显示结果。 -expression of the realization of a type. Arithmetic expressions of the legitimate input data includes variables (A ~ Z, a-z), constants (0-9) and two yuan Operators (+,-,*,/,^( 207.142.131.235)). Procedures for data input format is not asking for, users need to ensure their correct grammar, as detailed user manual. 2. Demonstration Program in man-machine dialogue on the implementation of the computer that is displayed on the prompt message, by the user at the keyboard corresponding to the input data or orders, procedures corresponding to the implementation of the operation and display the next message. 3. Procedures for the implementation of the order include : 1) According to user input automatically adds the prefix expression brackets and the establishment of its natural forms of written 下载
|