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
उत्तर
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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?