1 / 10

st A

中置記法( IN ) → 後置記法( RPN ) 例)  1 + 2 * 3 - 4. 数字は stA へ 演算子 は st B へ. st A. st B. 中置記法( IN ) → 後置記法( RPN ) 例)  1 + 2 * 3 - 4. st A. st B. 1. 中置記法( IN ) → 後置記法( RPN ) 例)  1 + 2 * 3 - 4. st A. st B. 1. +. 中置記法( IN ) → 後置記法( RPN ) 例)  1 + 2 * 3 - 4. st A. st B. 2. 1. +.

Download Presentation

st A

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 中置記法(IN) → 後置記法(RPN) 例) 1 + 2 * 3 - 4 数字はstAへ 演算子はstBへ stA stB

  2. 中置記法(IN) → 後置記法(RPN) 例) 1 + 2 * 3 - 4 stA stB 1

  3. 中置記法(IN) → 後置記法(RPN) 例) 1+ 2 * 3 - 4 stA stB 1 +

  4. 中置記法(IN) → 後置記法(RPN) 例) 1+2 * 3 - 4 stA stB 2 1 +

  5. 中置記法(IN) → 後置記法(RPN) 例) 1+2* 3 - 4 priority(“*”) > priority(“+”) * stA stB 2 * 1 +

  6. 中置記法(IN) → 後置記法(RPN) 例) 1+2*3 - 4 stA stB 3 2 * 1 +

  7. 中置記法(IN) → 後置記法(RPN) 例) 1+2*3- 4 priority(“-”) < priority(“*”) priority(“-”) = priority(“+”) - + * stA stB 3 2 * 1 - +

  8. 中置記法(IN) → 後置記法(RPN) 例) 1+2*3-4 4 + * stA stB 3 2 1 -

  9. 中置記法(IN) → 後置記法(RPN) 例) 1+2*3-4 stB: -,4,+,*,3,2,1 ※ RPNの逆順にsortされている 1個ずつ取り出す 1 4 2 + 3 * * stA stB 3 + 2 4 1 -

  10. 中置記法(IN) → 後置記法(RPN) 例) 1+2*3-4 ↓ 1 2 3 * + 4 - 1個ずつ取り出す 1 2 3 * stB + 4 -

More Related