conversion from infix to prefix

后端 未结 14 1304
有刺的猬
有刺的猬 2020-12-09 10:24

I am preparing for an exam where i couldn\'t understand the convertion of infix notation to polish notation for the below expression:

(a–b)/c*(d + e – f / g)         


        
14条回答
  •  [愿得一人]
    2020-12-09 10:52

    (a–b)/c*(d + e – f / g)
    

    step 1: (a-b)/c*(d+e- /fg))

    step 2: (a-b)/c*(+de - /fg)

    step 3: (a-b)/c * -+de/fg

    Step 4: -ab/c * -+de/fg

    step 5: /-abc * -+de/fg

    step 6: */-abc-+de/fg

    This is prefix notation.

提交回复
热议问题