基于二叉树的将中缀表达式转换为前缀表达式的方法  被引量:1

Method for Transformation of Infix Expression into Prefix Expression Based on Binary Tree

在线阅读下载全文

作  者:胡云 

机构地区:[1]无锡广播电视大学,江苏无锡214011

出  处:《成都大学学报(自然科学版)》2012年第3期247-250,263,共5页Journal of Chengdu University(Natural Science Edition)

摘  要:中缀表达式是使用频率最高的表达式形式,对其求值时,一方面要考虑表达式中运算符的优先级,另一方面还要考虑运算符的结合性.尽管运用人的思维能容易地判断中缀表达式的运算顺序,但使用计算机直接处理就会显得非常困难.提出一种基于二叉树的方法,即将中缀表达式转换为前缀表达式,然后在计算机上就可以实现简单求值.Infix expression has the highest usage frequency. For solution, on one hand, priority of operator in expression should be considerd. On the other hand, associativity of operator must considered too. Although it is not difficult for human being' s thinking to judge the operation order of infix expression, it is very difficult for computer to compute directly. A method was proposed based on the binary tree, which transform infrx expression into prefex expression, then solution rules will be simple for computer computing.

关 键 词:中缀表达式 前缀表达式 二叉树 

分 类 号:TP311.12[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象