Detailed Print – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Solved Problem#CPP#5885

Problem Statement - 03E

Convert the following infix expression to its equivalent postfix expression, showing the stack contents for each step of conversion.
X / Y + U* (V-W)

Solution

Click to open popup

Solved Problem Understanding

Element Stack Postfix
(
(
X X
/ / X
Y / XY
) XY/
+ + XY/
( + XY/
U + XY/U
* +* XY/U
( +* XY/U
V +* XY/UV
V- +*- XY/UV
W +*- XY/UVW
) +* XY/UVW-
) + XY/UVW-*
) XY/UVW-*+