In: Computer Science
Illustrate step-by-step the stack algorithm to convert this to
postfix.
a + b * (d * e + f)
Answer)
The step-by-step conversion of the following expression to postfix
is:
a + b * (d * e + f)
Following are the steps:
Input string - Output string - Operator stack
a + b * (d * e + f) a
a + b * (d * e + f) a
a + b * (d * e + f) a +
a + b * (d * e + f) a +
a + b * (d * e + f) a b +
a + b * (d * e + f) a b +
a + b * (d * e + f) a b +*
a + b * (d * e + f) a b +*
a + b * (d * e + f) a b +*(
a + b * (d * e + f) a b d +*(
a + b * (d * e + f) a b d +*(
a + b * (d * e + f) a b d +*(*
a + b * (d * e + f) a b d +*(*
a + b * (d * e + f) a b d e +*(*
a + b * (d * e + f) a b d e +*(*
a + b * (d * e + f) a b d e * +*(+
a + b * (d * e + f) a b d e * +*(+
a + b * (d * e + f) a b d e * f +*(+
a + b * (d * e + f) a b d e * f+ +*
a + b * (d * e + f) a b d e * f+*+
Thus the POSTfix would be:
a b d e * f+*+
**Please Hit Like if you appreciate my answer. For further doubts on the or answer please drop a comment, I'll be happy to help. Thanks for posting.**