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.

Host this setFree Play

The 20 questions

  1. What is the Reverse Polish notation (postfix) form of the infix expression a + b?

    • a b +
    • a b + 1
    • + a b
    • a + b
  2. 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
  3. 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
  4. Which of these is an example of a stack-based system that uses RPN-style code?

    • HTML
    • PostScript
    • SQL
    • Spreadsheet formulas only
  5. 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
  6. Which RPN form represents the infix expression a * (b + c)?

    • * a + b c
    • a b * c +
    • a b + c *
    • a b c + *
  7. What is the value of the RPN expression 3 4 + 2 *?

    • 10
    • 24
    • 14
    • 11
  8. 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 -
  9. What is the value of the RPN expression 5 1 2 + 4 * + 3 -?

    • 17
    • 12
    • 14
    • 20
  10. What is the value of the infix expression 2 * 3 + 4 evaluated via its RPN form?

    • 9
    • 14
    • 10
    • 24
  11. Which RPN form represents the infix expression a - b - c?

    • a - b c -
    • a b - c -
    • a b c - -
    • - a - b c
  12. What is the value of the RPN expression 6 2 / 3 +?

    • 4.5
    • 1
    • 9
    • 6
  13. Which RPN form represents the infix expression a + b * c?

    • + a * b c
    • a b c * +
    • a b c + *
    • a b + c *
  14. Which RPN form represents the infix expression a - (b - c)?

    • a b c + -
    • a b c - -
    • a b - c -
    • - a b c
  15. An RPN expression a b c * + is evaluated with a = 1, b = 2 and c = 3. What is the result?

    • 10
    • 7
    • 9
    • 5
  16. 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 / + -
  17. What is the value of the RPN expression 2 3 + 4 5 * -?

    • 15
    • -25
    • -15
    • 25
  18. Which RPN sequence would cause a stack underflow during evaluation?

    • 5 1 2 + 4 * + 3 -
    • 1 2 + +
    • 1 2 + 3
    • 3 4 * 2 -
  19. 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
  20. What is the value of the RPN expression 4 2 * 3 -?

    • 5
    • 2
    • 11
    • 8

All AQA Computer Science quizzes