Skip to main contentSkip to solution

Match the LIST-I with LIST-II

LIST-ILIST-II
A.Conversion of an Infix notation to its equivalent Prefix/Postfix notationI.Only operands are PUSHed onto it.
B.When evaluating any Postfix expression using StackII.(x + y)/(z * 5)
C.Example of Infix notationIII.Only operators are PUSHed onto the Stack.
D.Example of Prefix (Polish) notationIV./+xy*z5

Solution

✅ Correct Option: 4
List IList 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 (x+y)/(z∗5)(x + y)/(z * 5), while Prefix has the operator before its operands, as in /+xy∗z5/+xy*z5.

Options 2 and 3: reverse the stack roles. Only operands are pushed during evaluation, not during conversion.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question