-->

Linked List, Stack And Queue

Question
CBSEENCO12011527

Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion.
P + ( Q - R ) * S / T

Solution

Conversion of  the given Infix expression to its equivalent Postfix expression
(P+(((Q-R)*S)/T))

INFIX STACK POSTFIX
( (  
P ( P
+ (+ P
( (+( P
Q (+( PQ
- (+(- PQ
R (+(- PQR
) (+ PQR-
* (+* PQR-
S (+* PQR-S
/ (+/ PQR-S*
T (+/ PQR-S*T
)   PQR-S*T/+