GATE CS 2004 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0235

Assume that the operators \(+\), \(-\), \(\times\) are left associative and \(\wedge\) (exponentiation) is right associative. The order of precedence (from highest to lowest) is \(\wedge\), \(\times\), \(+\), \(-\). The postfix expression corresponding to the infix expression \(a + b \times c - d \wedge e \wedge f\) is
  1. A
    \(\text{abc} \times + \text{def} \wedge \wedge -\)
  2. B
    \(\text{abc} \times + \text{de} \wedge \text{f} \wedge -\)
  3. C
    \(\text{ab} + \text{c} \times \text{d} - \text{e} \wedge \text{f} \wedge\)
  4. D
    \(\text{axbc} \wedge \wedge \text{def}\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1035/gate2004-38-isro2009-27

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com