4.3.3 Reverse Polish Notation Flashcards
Which of the following is true of RPN:
1. It uses a queue
2. It eliminates the need for brackets
3. It’s based on Graphs
It eliminates the need for brackets
Which of the following is true of RPN:
1. It uses a queue
2. It eliminates the need for brackets
3. It’s based on Graphs
It eliminates the need for brackets
Convert to RPN
14 + 6
146+
Conv. infix to RPN
(12 - 4) x (3 + 5)
12 4 - 3 5 + x
Conv. RPN to Infix
13 6 + 4 -
(13 + 6) - 4
Conv. RPN to Infix
13 6 + 4 -
(13 + 6) - 4
Conv. Infix to RPN
3 (4 - 2) + 9
4 2 - 3 x 9 +
Conv. RPN to Infix
4 6 7 + -
4 - (6 + 7)
Which of the following is not an example of where RPN is used:
1. Prescript
2. Bytescode
3. Postscript
PreScript
Which of the following is not an example of where RPN is used:
1. Prescript
2. Bytescode
3. Postscript
PreScript
What is the result?
2 8 x 2 4 - x
- 2 8 x 2 4 - x
- (2 x 8) x (2 - 4)
- -32
What is the result?
4 6 8 – –
- 4 6 8 - -
- 4 - (6 - 8)
- 4 - (-2)
- 6