retagged by
1,230 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$
retagged by

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 votes
1 votes
$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

3 votes
3 votes
2 answers
4
admin asked Mar 30, 2020
6,567 views
A balance factor in AVL tree is used to checkwhat rotation to makeif all child nodes are at same levelwhen the last rotation occurredif the tree is unbalanced