Yr2 Reverse Polish Notation Flashcards

(6 cards)

1
Q

What are the 4 advantages of reverse Polish notation?

A
  1. Easy for computers to evaluate
  2. No brackets required to show order of operation
  3. Operators appear in required order
  4. No need to order of precedence of operators
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What data structure is required for reverse Polish notation?

A

A stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is reverse polish translated into in fix notation?

A

If it is a number append to stack.
If it is an operator pop the top two items from the stack, the top one goes on the right of the operator and the other on the left. Append result to the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write 162/(2+1)^4 in RPN

A

162 2 1 + 4 ^ /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the result of: 6 3 - 2 ^ 11 -

A

(6-3)^2 -11=-2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the method for writing fixed expressions in Polish notation?

A

Find the operation that you would perform first according to bidmas write it down and then work outwards from there

How well did you know this?
1
Not at all
2
3
4
5
Perfectly