prefix, infix, suffix expression

Source: Internet
Author: User

Topic Source HTTP://WWW.NOWCODER.COM/QUESTIONTERMINAL/7FB8BA37F48C4FEAAF518F221CAEFCB4

Infix expression (a+b) *c* (d-e/f) turn suffix yes?

In fact, look at the explanation, here the so-called prefix, infix and suffix expression in the two-fork tree in the preamble, middle order, post-order traversal almost, meaning is a meaning.

For this kind of problem, we can draw a two-fork tree suitable for the topic, and then find out the answer we need.

For example, the above topic:

We can draw the following two-fork tree:

You can get the answer we need by doing a sequential traversal of it: ab+c*def/-*

After a sequential traversal of it, you can get: ab+cdef/-**

Picture by

Shangshilema

prefix, infix, suffix expression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.