Practice mode Data Structures

What is the postfix form of the infix expression (A + B) * (C − D)?

Correct answer B. A B + C D − *

Explanation

Parentheses force each sum or difference to be evaluated before the multiplication. In postfix, each operator follows its two operands, so (A + B) becomes A B +, (C − D) becomes C D −, and the multiplication of the two results comes last. The option beginning with * is the prefix (Polish) form, where operators come before their operands.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.