मराठी

Convert the Following Infix Expression to Its Equivalent Postfix Expression, Showing the Stack Contents for Each Step of Conversion: X-( Y+Z )/U * V - Computer Science (C++)

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2016-2017 (March) All India Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×