# UGCNET-Dec2014-II: 21

3.4k views

Convert the following infix expression into its equivalent post fix expression $(A + B$^$D) / (E – F) + G$

1. $ABD$^ $+EF – / G+$
2. $ABD +$^$EF – / G+$
3. $ABD +$ ^$EF / – G+$
4. $ABD$^ $+ EF / – G+$
in DS
edited

Given Expression is (A + B^D ) / (E - F) + G

first we look at precedence and associativity and a/c to that "()" has higher precedence among all operators so we are going to evaluate them first .Lets take this first  (A + B^D )

inside this again we have 2 operators one is "+" and other is "^" in which Exponentiation operator has higher precedence .so

it will evaluate it like this

A+ BD^  then  ABD^+ now let move to the second one which is (E - F)  it will be EF- till now we have

ABD^+  / EF- + G

Now among both operators which has to be evaluated  "/" has higher precedence so we'll evaluate it first

ABD^+EF- /+ G

now finally we are going to evaluate "+"

Final Postfix expression will be ABD^+EF-/G+

selected
0
here \ will come after - please correct it.
0
0

now,it is correct.

For the given expression , postfix notation is

ABD^+EF-/G+

I assume ^+ is merged to ^  in option A.

## Related questions

1
3.5k views
How many PUSH and POP operations will be needed to evaluate the following expression by reverse polish notation in a stack machine $(A ∗ B) + (C ∗ D/E)$? $4$ PUSH and $3$ POP instructions $5$ PUSH and $4$ POP instructions $6$ PUSH and $2$ POP instructions $5$ PUSH and $3$ POP instructions
A certain tree has two vertices of degree $4$, one vertex of degree $3$ and one vertex of degree $2$. If the other vertices have degree $1$, how many vertices are there in the graph ? $5$ $n – 3$ $20$ $11$
You have to sort a list $L$, consisting of a sorted list followed by a few ‘random’ elements. Which of the following sorting method would be most suitable for such a task ? Bubble sort Selection sort Quick sort Insertion sort
If we have six stack operationspushing and popping each of $A, B$ and $C$-such that push $(A)$ must occur before push $(B)$ which must occur before push $(C)$, then $A, C, B$ is a possible order for the pop operations, since this could be our sequence ... orders could not be the order the pop operations are run, if we are to satisfy the requirements described above? $ABC$ $CBA$ $BAC$ $CAB$