Advertisements
Advertisements
प्रश्न
Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion:
X-( Y+Z )/U * V
Advertisements
उत्तर
The expression is: X-( Y+Z )/U * V
= (X-(((Y+Z)/U)*V))
The postfix expression is as
| Operation | StackStatus | Output |
| ( | ( | |
| X | ( | X |
| - | (- | X |
| ( | (-( | X |
| ( | (-(( | X |
| ( | (-((( | X |
| Y | (-((( | XY |
| + | (-(((+ | XY |
| Z | (-(((+ | XYZ |
| ) | (-(( | XYZ+ |
| / | (-((/ | XYZ+ |
| U | (-((/ | XYZ+U |
| ) | (-( | XYZ+U/ |
| * | (-(* | XYZ+U/ |
| V | (-(* | XYZ+U/V |
| ) | (- | XYZ+U/V* |
| ) | empty | xyz+U/V*_ |
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
