logo

Question detail

Convert the infix expression (A + B) * (C - D) into RPN. Explain how the order of the RPN expression represents the brackets.

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

Question

Type

practice

Style

Topic

Reverse Polish

Exam-style question

Try this first

Convert the infix expression (A + B) * (C - D) into RPN. Explain how the order of the RPN expression represents the brackets.

Model answer

What a good answer should say

  • AB+CD-*

Explanation

Why this works

The first bracketed sub-expression, A + B, becomes AB+. The second bracketed sub-expression, C - D, becomes CD-.

The multiplication operator is placed after both completed sub-expressions, producing AB+CD-*. The position of the operators preserves the order imposed by the brackets, so additional brackets are not required in the RPN form.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.