- 9
- 0
- 约3.88万字
- 约 11页
- 2017-06-08 发布于河南
- 举报
什么是前缀表达式(国外英文资料)
什么是前缀表达式(国外英文资料)
What is a prefix expression
Prefix expression is the arithmetic expression without parentheses, and it was written in front, and the operator operation number written on the back of the expression, also known as the polish. For example, minus 1 plus 2, 3, thats the same thing as 1 minus 2 plus 3.
Edit this section
How does the prefix expression evaluate
For a prefix expression is evaluated, the first expression to scan from right to left, start from the first character on the right judgment, if the current character is a number until the Numbers at the end of the recording again, if it is operator, is the right of the nearest two Numbers corresponding operation, as a new Numbers and recorded. Its always going to be scanning to the left end of the expression, and its going to be the value of the expression. Prefix expression, for example, 1 + 2, 3, scanning to 3, record the number series, scan to 2, record the Numbers, when scanning to + the + moves to the right to do the operator between two Numbers, the record of 2 + 3, the result is 5, record the new Numbers, and continue to scan, scan to 1, record the number series, scan to - to - moves to the right to do the operator between two Numbers, for 1 to 5, the results for 4, so the value of the expression is - 4.
Edit this section
What is the use of a prefix expression
The prefix expression is a very useful expressions, it can convert infix expression to rely on the simple operation can get result expression. For example, (a + b) * (c + d) translates to *, +, a, b, +, c, d. The advantage of this is that you can solve any of the infix expressions using only two simple operations. The method is: if the current character (or string) is numeric or variable, it is pressed into the stack. If the operator is an operator, the stack is pushed out of the top two elements of the stack and then pressed into the stack. When the prefix expression scan is over, the final result of the infix expression operation is i
您可能关注的文档
- 上海大学2016年汉语国际教导硕士考研招生简章专业目录(国外英文资料).doc
- 上海地铁线路车站中英文名字对照表(国外英文资料).doc
- 上海15年管帐再教导在线测验习题(国外英文资料).doc
- 三氯化六氨合钴的制备及其构成的测定(国外英文资料).doc
- 上海大学治理学院学术期刊认定标准(评论辩论稿)(国外英文资料).doc
- 上海大学管理学院毕业论文工作流程和格式规范(国外英文资料).doc
- 上海市宝山区、嘉定区2014年中考二模语文试题及答案(国外英文资料).doc
- 上海新编通用少儿英语星级测验(国外英文资料).doc
- 上海海事大学硕士学位论文模版及格式范文-2013最新版本(国外英文资料).doc
- 上海牛津英语动词过去式辅导讲义(国外英文资料).doc
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)