Question: The following code is to be written in C (NOT C++). Given a Prefix expression, convert it into a Postfix expression. Help: Read the Prefix
The following code is to be written in C (NOT C++). Given a Prefix expression, convert it into a Postfix expression.

Help: Read the Prefix expression in reverse order (from right to left) If the symbol is an operand, then push it onto the Stack If the symbol is an operator, then pop two operands from the Stack Create a string by concatenating the two operands and the operator after them. string = operand1 + operand2+ operator And push the resultant string back to Stack Repeat the above steps until end of Prefix expression. Input : Prefix+AB-CD Output : Postfix : AB+CD-* Explanation: Prefix to Infix (A+B) *(C-D) Infix to Postfix: AB+CD-* Input Prefix *-A/BC-/AKL Output : Postfix : ABC/-AK/L-* Explanation Prefix to Infix A- (B/C)* (A/K)-L Infix to Postfix: ABC/-AK/L-*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
