当前位置:网站首页>Prefix infix suffix expression (written conversion)
Prefix infix suffix expression (written conversion)
2022-07-26 08:18:00 【Fanshui 682】
Prefix infix suffix expression , In the final analysis, it is the traversal of the pre order, middle order and post order of the tree , So if you have learned the depth first traversal of trees , Such a transformation is small for you case 了 .
We know , If the infix expression is :2 + 6, The prefix expression is :+ 2 6, The postfix expression is 2 6 +. It can be concluded here that , When calculating expressions , No matter how to convert the form , The left and right numbers of binary operators will not change order , Only the position of the symbol is changed .
And then something magical happened

Expression and tree are perfectly combined !
Then I don't need to say more !
+ 2 6 Prefix expression It is also preorder traversal
2 + 6 Infix expression It is also a middle order traversal
2 6 + Postfix expression Post order traversal again
This is the wonderful use of trees , It's also X The essence of infix expression !
边栏推荐
- Burp suite Chapter 9 how to use burp repeater
- Vscode domestic image server acceleration
- sed作业
- 随机分布学习笔记
- Exam summary on June 27, 2022
- ORACLE 官方文档
- Software engineering -- dental clinic -- demand analysis
- 2022-07-08 group 5 Gu Xiangquan's learning notes day01
- C # get the information of the selected file
- R language foundation
猜你喜欢
随机推荐
Burp Suite-第二章 Burp Suite代理和浏览器设置
Understand microservices bit by bit
2022-07-08 group 5 Gu Xiangquan's learning notes day01
Pycharm code specification tool flake8
Exam summary on June 30, 2022
Rewriting and overloading
线程崩了,为什么不会导致 JVM 崩溃呢?如果是主线程呢?
我,35岁了。
有点牛逼,一个月13万+
日常一记(11)--word公式输入任意矩阵
2022-07-09 group 5 Gu Xiangquan's learning notes day02
Summary of traversal methods of list, set, map, queue, deque and stack
一键部署LAMP和LNMP架构
The idea of stack simulating queue
JSP action -- usebean action
美女裸聊一时爽,裸聊结束火葬场!
JSP implicit object -- scope
【 fastjson1.2.24反序列化漏洞原理代码分析】
BGP选路原则
Spotty music data client_ ID account









