Q. Convert the following infix expression to its equivalent postfix expression showing stack contents for the conversion: X - Y / (Z + U) * V

Answer :-

 
ELEMENT STACK POSTFIX
X
X
- - X
( -( X
Y -( XY
+ - ( + XY
Z - ( + XYZ
) - XYZ+
/ -/ XYZ+
U -/ XYZ + U
* -* XYZ + U/
V -* XYZ +U/V


XYZ+U/V*-

 

Final Answer :- XYZ+U/V*-


3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post