中置記法(
This presentation is the property of its rightful owner.
Sponsored Links
1 / 10

st A PowerPoint PPT Presentation


  • 41 Views
  • Uploaded on
  • Presentation posted in: General

中置記法( 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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


St a

中置記法(IN) → 後置記法(RPN)

例) 1 + 2 * 3 - 4

数字はstAへ

演算子はstBへ

stA

stB


St a

中置記法(IN) → 後置記法(RPN)

例) 1 + 2 * 3 - 4

stA

stB

1


St a

中置記法(IN) → 後置記法(RPN)

例) 1+ 2 * 3 - 4

stA

stB

1

+


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2 * 3 - 4

stA

stB

2

1

+


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2* 3 - 4

priority(“*”) > priority(“+”)

*

stA

stB

2

*

1

+


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2*3 - 4

stA

stB

3

2

*

1

+


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2*3- 4

priority(“-”) < priority(“*”)

priority(“-”) = priority(“+”)

-

+

*

stA

stB

3

2

*

1

-

+


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2*3-4

4

+

*

stA

stB

3

2

1

-


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2*3-4

stB: -,4,+,*,3,2,1

※ RPNの逆順にsortされている

1個ずつ取り出す

1

4

2

+

3

*

*

stA

stB

3

+

2

4

1

-


St a

中置記法(IN) → 後置記法(RPN)

例) 1+2*3-4

1 2 3 * + 4 -

1個ずつ取り出す

1

2

3

*

stB

+

4

-


  • Login