Match the LIST-I with LIST-II
LIST-I LIST-II A. Conversion of an Infix notation to its equivalent Prefix/Postfix notation I. Only operands are PUSHed onto it. B. When evaluating any Postfix expression using Stack II. (x + y)/(z * 5) C. Example of Infix notation III. Only operators are PUSHed onto the Stack. D. Example of Prefix (Polish) notation IV. /+xy*z5
Match the LIST-I with LIST-II
| LIST-I | LIST-II | ||
|---|---|---|---|
| A. | Conversion of an Infix notation to its equivalent Prefix/Postfix notation | I. | Only operands are PUSHed onto it. |
| B. | When evaluating any Postfix expression using Stack | II. | (x + y)/(z * 5) |
| C. | Example of Infix notation | III. | Only operators are PUSHed onto the Stack. |
| D. | Example of Prefix (Polish) notation | IV. | /+xy*z5 |
Solution
✅ Correct Option: 4
| List I | List II |
|---|---|
| (A) Infix to Prefix/Postfix conversion | (III) Only operators are PUSHed onto the Stack. |
| (B) Evaluating a Postfix expression using Stack | (I) Only operands are PUSHed onto it. |
| (C) Example of Infix notation | (II) (x + y)/(z * 5) |
| (D) Example of Prefix (Polish) notation | (IV) /+xy*z5 |
In conversion, operands go straight to the output and only operators (and brackets) are held on the stack. In postfix evaluation, operands are pushed, and each operator pops two operands and pushes back the result.
Options 1 and 3: swap the Infix and Prefix examples. Infix has the operator between operands, as in , while Prefix has the operator before its operands, as in .
Options 2 and 3: reverse the stack roles. Only operands are pushed during evaluation, not during conversion.
Related questions:
2025: 27 May Shift 2
2025: 22 May Shift 1
2025: 16 May Shift 1
2025: 27 May Shift 2