Given an expression
$(A+B*D)/(E-F)+G$
-
The prefix notation is $+/+A*DB-EFG$
-
The prefix expression is the reverse of the postfix expression
-
The order of operands in infix expression and postfix expression are the same.
-
The order of operands in infix expression, prefix expression, and postfix expression are the same.
Choose the most appropriate answer from the options given below:
π₯ Video solution / Text Solution of this question is given below:
Given expression is:
$(A+B*D)/(E-F)+G$
First solve according to operator precedence:
$B*D$
So, expression becomes:
$(A+(B*D))/(E-F)+G$
Prefix of $B*D$ is:
$*BD$
Prefix of $A+B*D$ is:
$+A*BD$
Prefix of $E-F$ is:
$-EF$
Now prefix of $\frac{A+B*D}{E-F}$ is:
$/+A*BD-EF$
Finally add $G$:
$+/+A*BD-EFG$
So, statement $1$ is true.
Prefix is not simply the reverse of postfix.
So, statement $2$ is false.
The order of operands in infix and postfix remains:
$A,B,D,E,F,G$
So, statement $3$ is true.
The order of operands in infix, prefix, and postfix also remains the same:
$A,B,D,E,F,G$
So, statement $4$ is true.
Correct statements are:
$1,3,$ and $4$