Lesson 4.3.3.1
4.3.3.1 Infix to Reverse Polish notation Quiz: AQA Computer Science, Unit 3
20 questions
In partnership with Revision Ninja
Lesson 4.3.3.1, Infix to Reverse Polish notation: 20 multiple choice questions for the AQA Computer Science (7517), Unit 3: Fundamentals of algorithms, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What is the Reverse Polish notation (postfix) form of the infix expression a + b?
- a b +
- a b + 1
- + a b
- a + b
-
What main benefit does Reverse Polish notation provide over infix notation?
- It evaluates expressions in parallel automatically
- It removes the need for brackets within sub-expressions
- It allows operators to appear only at the start of an expression
- It makes expressions shorter by removing operands
-
Which kind of system evaluates Reverse Polish expressions using a stack?
- A queue-based task scheduler
- A stack-based interpreter, such as one for PostScript or bytecode
- A hash table lookup
- A binary tree walker
-
Which of these is an example of a stack-based system that uses RPN-style code?
- HTML
- PostScript
- SQL
- Spreadsheet formulas only
-
When an operand is read during stack evaluation of an RPN expression, what happens to it?
- It is compared with the top operator
- It is pushed onto the stack
- It is sent to the output as an operator
- It is discarded
-
Which RPN form represents the infix expression a * (b + c)?
- * a + b c
- a b * c +
- a b + c *
- a b c + *
-
What is the value of the RPN expression 3 4 + 2 *?
- 10
- 24
- 14
- 11
-
Which RPN expression is equivalent to the infix (a + b) * c - d?
- a b + c d * -
- - * + a b c d
- a b c + * d -
- a b + c * d -
-
What is the value of the RPN expression 5 1 2 + 4 * + 3 -?
- 17
- 12
- 14
- 20
-
What is the value of the infix expression 2 * 3 + 4 evaluated via its RPN form?
- 9
- 14
- 10
- 24
-
Which RPN form represents the infix expression a - b - c?
- a - b c -
- a b - c -
- a b c - -
- - a - b c
-
What is the value of the RPN expression 6 2 / 3 +?
- 4.5
- 1
- 9
- 6
-
Which RPN form represents the infix expression a + b * c?
- + a * b c
- a b c * +
- a b c + *
- a b + c *
-
Which RPN form represents the infix expression a - (b - c)?
- a b c + -
- a b c - -
- a b - c -
- - a b c
-
An RPN expression a b c * + is evaluated with a = 1, b = 2 and c = 3. What is the result?
- 10
- 7
- 9
- 5
-
Which RPN form represents the infix expression a + b * c - d / e?
- a b c * + d e / -
- - + a * b c / d e
- a b + c * d e / -
- a b c * d e / + -
-
What is the value of the RPN expression 2 3 + 4 5 * -?
- 15
- -25
- -15
- 25
-
Which RPN sequence would cause a stack underflow during evaluation?
- 5 1 2 + 4 * + 3 -
- 1 2 + +
- 1 2 + 3
- 3 4 * 2 -
-
Why must a stack-based evaluator process an RPN expression from left to right?
- Operators must appear before operands
- The stack must hold brackets
- Each operator's operands are the two items on top of the stack at that point
- RPN is read from right to left
-
What is the value of the RPN expression 4 2 * 3 -?
- 5
- 2
- 11
- 8
Related quizzes
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Pre-order, post-order and in-order traversal Quiz · 4.3.2.1 · 20 questions
- Linear and binary search Quiz · 4.3.4.1 · 20 questions
- Binary tree search Quiz · 4.3.4.3 · 20 questions
- Bubble sort Quiz · 4.3.5.1 · 20 questions
- Merge sort Quiz · 4.3.5.2 · 20 questions
- Dijkstra's shortest path algorithm Quiz · 4.3.6.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions