一种应用数组计算复杂算术表达式的算法设计  

An Algorithm Design for Calculating Complicated Arithmetic Expression Using Array

在线阅读下载全文

作  者:陈亭志[1] 程利民[1] Chen Tingzhi;Cheng Limin(College of Mechanical and Electrical Engineering,Wuhan Polytechnic,Wuhan430074,China)

机构地区:[1]武汉职业技术学院机电工程学院,湖北武汉430074

出  处:《武汉职业技术学院学报》2021年第6期106-112,共7页Journal of Wuhan Polytechnic

基  金:2020年武汉职业技术学院课题“基于输出式学习理论的在线课程有效教学”(项目编号:2020YJ002)。

摘  要:算术表达式的计算是C语言程序设计中经典数学问题,计算机在解决这个问题时,一般是用逆波兰算法,把中缀表达式转化为后缀表达式,然后再使用栈计算实现,这种算法利用递归的思想,并结合栈复杂数据结构才能实现。设计一种算法,通过将运算符进行优先级排序,找到了复杂计算问题的简化模型,只需要应用循环和数组就可以实现复杂算术表达式的计算。The calculation of arithmetic expressions is a classic mathematical problem in C language programming.When a computer solves this problem,it usually uses the inverse Polish algorithm to convert the infix expression into a suffix expression,and then use the stack calculation to implement this algorithm.It can be realized only by using the idea of recursion and combining the complex data structure of the stack.In this paper,an algorithm is designed.By prioritizing operators,a simplified model of complex calculation problems is found.The calculation of complex arithmetic expressions can be realized by using loops and arrays.

关 键 词:逆波兰 算术表达式计算 数组 优先级 

分 类 号:TP301.5[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

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