All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2022 (Shift 2)

Given the expression (A + B * D)/(E − F) + G: 1. The prefix notation is + / + A * D B − E F G. 2. The prefix expression is the reverse of the postfix expression. 3. The order of operands in infix and postfix is the same. 4. The order of operands in infix, prefix and postfix is the same.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 3 and 4 Only

Explanation

The correct prefix form is + / + A * B D − E F G, so statement 1 (with D B) is wrong. Prefix is not simply postfix reversed (2 false). Converting between notations moves only operators, so operands keep their order in all three forms (3 and 4 true).

More Data Structures and Algorithms questions