Q. Convert the given infix expression into the postfix expression (also Show the steps)
A ∗ (B + D)/ E - F(G + H / k )
Ans.
Steps showing Infix to Post fix
Symbol
|
Postfix String
|
Opstk
|
A
|
A
|
|
*
|
A
|
*
|
(
|
A
|
*(
|
B
|
AB
|
*(
|
+
|
AB
|
*(+
|
D
|
ABD
|
*(+
|
)
|
ABD+
|
*(
|
/
|
ABD+*
|
/
|
E
|
ABD+*E
|
/
|
-
|
ABD+*E/
|
-
|
F
|
ABD+*E/F
|
-
|
*
|
ABD+*E/F
|
-
|
(
|
ABD+*E/F
|
-(
|
G
|
ABD+*E/FG
|
-(
|
+
|
ABD+*E/FG
|
-(+
|
H
|
ABD+*E/FGH
|
-(+
|
/
|
ABD+*E/FGH
|
-(+/
|
K
|
ABD+*E/FGHK
|
-(+/
|
)
|
ABD+*E/FGHK/+-
|
|