Question: Postfix expression to infix expression: Read the postfix expression from left to right and to the following: If the current character in the postfix is
Postfix expression to infix expression: Read the postfix expression from left to right and to the following: If the current character in the postfix is a space, ignore it. If the current character is an operand, push it on the stack If the current character is an operator, 1. Pop the top 2 values from the stack. If there are fewer then 2 values throw an error 2. Create a string with 1st value and then the operator and then the 2nd value. 3. Encapsulate the resulting string within parenthesis 4. Push the resulting string back to the stack When the postfix expression has been read: If there is only one value in the stack it is the infix string, if more than one value, throw an error
Step by Step Solution
There are 3 Steps involved in it
The question is incomplete It seems to be an explanatio... View full answer
Get step-by-step solutions from verified subject matter experts
