35. Convert the following Infix expression to Postfix form using a stack.
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

a) xyz+pqr+s+

b) xyz+pqr+s+
c) xyz+pqr+s+

d) xyzp+qr+s+

Answer: a
Explanation: The Infix Expression is x + y * z + (p * q + r) * s. (x y z ) + (p * q + r) * s. ‘+’, ‘*’ are present in stack. (x y z * + p q * r) * s. ‘+’ is present in stack. x y z * + p q * r + s * +. Thus Postfix Expression is x y z * + p q * r + s * +.

Leave a Reply

Your email address will not be published.