in DS retagged by
1,202 views
4 votes
4 votes

Assume that the operators $+,-,\times$ are left associative and $\wedge$ 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. $abc\times+def\wedge\wedge-$
  2. $abc\times+de\wedge f\wedge-$
  3. $ab+c\times d-e\wedge f\wedge $
  4. $-+a\times bc\wedge\wedge def$
in DS retagged by
by
1.2k views

1 comment

i think A is the ansewer
0
0

3 Answers

2 votes
2 votes

 

Fully Parenthesized expression is: ((a+(b×c))−(d∧(e∧f )))

Therefore, the postfix express is: abc×+def∧∧−

Hence, option A. is correct.

1 vote
1 vote
Option A should be correct.
1 vote
1 vote
$a+b*c-d\wedge e\wedge f$

$a+b*c-d\wedge (e\wedge f)$

$a+b*c-(d\wedge e f\wedge)$

$a+(b*c)-de f\wedge\wedge$

$(a+bc*)\ -\ de f\wedge\wedge$

$((abc*+) \ -\ (de f\wedge\wedge))$

$abc*+ de f\wedge\wedge-$

Option $(A)$ is correct.
Answer:

Related questions