登录
首页 » 数据结构 » 数据结构堆栈之后缀表达式求值

数据结构堆栈之后缀表达式求值

于 2022-11-10 发布 文件大小:1.96 MB
0 413
下载积分: 2 下载次数: 1

代码说明:

此程序用的是后缀表达式求值的方法,其中用到了一个栈,而中缀表达式求值需用到两个栈(操作数栈和操作符栈),所以阅读程序前提是了解中缀表达式和后缀表达式 之间的转换,和后缀表达式求值的过程。关于他们之间的转换,我的概括为:中缀表达式:a*(b+c)-d/f  ,先做b+c,即bc+;再做a*(b+c),即abc+*;然后做d/f,即df/; 最后做a*(b+c)-d/f,得abc+*df/-。关于后缀表达式求值过程请参照你的《数据结构指导书》P60~62(下文所指参照页均在此书)。程序里中有些我说的可有可无的东西,我已经说明 程序里只给出了+ - * / 四种运算,其它运算符若需要, 可向程序里插入。你的指导书堆栈实验里提示用到了“运算符重载”,所以添加其他运算时,有可能用到重载,但这里的四则运算我没用到,运算符重载是很重要的

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 链表的基本操作,循环链表的一个应用实例,围桌问题的一个解决方法!...
    链表的基本操作,循环链表的一个应用实例,围桌问题的一个解决方法!-Chain basic operation, the recycling Chain an example, sat around the table in a solution!
    2022-02-02 21:49:31下载
    积分:1
  • 用链表求300的阶乘,并且返回链表节点的个数.
    用链表求300的阶乘,并且返回链表节点的个数.-used for the factorial 300, and returned to the linked list node number.
    2022-03-17 21:47:18下载
    积分:1
  • Realize stack code, realize all the features of the stack, PUSH, POP, insertion,...
    堆栈的实现代码,实现了栈的所有功能,PUSH,POP,插入,销毁,清空等,有调试程序,可以很清楚的看到栈的运行过程-Realize stack code, realize all the features of the stack, PUSH, POP, insertion, destruction, empty and so on, have a debugger, you can clearly see the operation of the process stack
    2022-03-25 07:40:01下载
    积分:1
  • Example VB Code in an Excel*. xls file for programmatically recalculating and re...
    Example VB Code in an Excel *.xls file for programmatically recalculating and resizing DataLink functions. Last Updated July 2006-Example VB Code in an Excel*. xls file for programmatically recalculating and resizing DataLink functions. Last Updated July 2006
    2022-06-21 06:59:59下载
    积分:1
  • 停车场管理系统的源代码
    由于停车场是一个狭窄通道,而且只有一个大门可供汽车进出,问题要求汽车停车场内按车辆到达时间的先后顺序,依次由北向南排列。由此很容易联想到数据结构中的堆栈模型,因此可首先设计一个堆栈,以堆栈来模拟停车场,我设计用顺序存储结构来存储停车场内的车辆信息,并给车辆按进栈顺序编号,当停车场内某辆车要离开时,在他之后进入的车辆必须先退出车场为它让路,待该辆车开出大门外,其他车辆再按原次序进入停车场。这是个一退一进的过程,而且让道的汽车必须保持原有的先后顺序,因此可再设计一个堆栈,以之来暂时存放为出站汽车暂时让道的汽车。当停车场满后,继续进来的汽车需要停放在停车场旁边的便道上等候,若停车场有汽车开走,则按排队的先后顺序依次进站,最先进入便道的汽车将会最先进入停车场,这完全是一个先进先出模型,因此可设计一个队列来模拟便道,队列中的数据元素设计成汽车的车牌号,并以链表的形式存储。另外,停车场根据汽车在停车场内停放的总时长来收费的,在便道上的时间不计费,因此必须记录车辆进入停车场时的时间和车辆离开停车场时的时间,然后计算、显示费用情况。
    2023-04-01 23:20:03下载
    积分:1
  • 2.1将n个人围成一圈,m为未进入游戏前的先行码,用来淘汰第一个出 局的人,然后依次给出淘汰者的密码,根据输入的密码来确定下一个淘汰是哪一个,并依次输出被淘汰的...
    2.1将n个人围成一圈,m为未进入游戏前的先行码,用来淘汰第一个出 局的人,然后依次给出淘汰者的密码,根据输入的密码来确定下一个淘汰是哪一个,并依次输出被淘汰的人对应的号码。 2.2用单向循环链表实现操作。-2.1 n personal cordons m not yet entered the game before the first yards out for the first out, then eliminated were given the password, the password to determine under which a one-out, and turn out the output of the corresponding number. 2.2 List circle with a one-way operation to achieve.
    2022-01-26 01:24:55下载
    积分:1
  • 本文介绍了数据结构中的选择排序,希尔排序等算法,采用全英文版,真实可靠...
    本文介绍了数据结构中的选择排序,希尔排序等算法,采用全英文版,真实可靠-This paper introduces the data structure of choice, in order of ranking algorithms such as Hill, was used in English, true and reliable
    2022-02-25 02:55:34下载
    积分:1
  • 八皇后问题:用回溯算法做的
    八皇后问题:用回溯算法做的 -8 Queens : The backtracking algorithm
    2023-05-20 18:50:03下载
    积分:1
  • primary structure of the data entry ranking eight small procedures, interested t...
    初级入门数据结构的排序等8个小程序,有兴趣的看看哈!我的作业,呵呵!-primary structure of the data entry ranking eight small procedures, interested to see Ha! I work, Ha ha!
    2022-11-03 07:55:03下载
    积分:1
  • A detailed book information management system, including storage, a library, que...
    一个详实的图书信息管理系统,包括入库、出库,查询等功能模块,和一个简单的系统帮助文件。-A detailed book information management system, including storage, a library, query, such as function modules, and a simple system to help document.
    2023-04-24 02:05:06下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载