Convert Infix Expression to Postfix Expression: P/(Q-R)*S+T
Convert the following infix expression to its equivalent postfix expression
showing the stack contends for each step of conversions.
(P/(Q-R)*S+T)
Symbol
|
Stack
|
Expression
|
(
|
(
|
-
|
P
|
(
|
P
|
/
|
(/
|
P
|
(
|
(/(
|
P
|
Q
|
(/(
|
PQ
|
-
|
(/(-
|
PQ
|
R
|
(/(-
|
PQR
|
)
|
(/
|
PQR-
|
*
|
(*
|
PQR-/
|
S
|
(*
|
PQR-/S
|
+
|
(+
|
PQR-/S*
|
T
|
(+
|
PQR-/S*T
|
)
|
PQR-/S*T+
|
So the postfix expression is
PQR-/S*T+
No comments
Post your comments