# Infix to Postfix converter

Infix:

Postfix:

## Step by step Evaluation for **““** expression

## Step by Step Evaluation for postfix expression

Input String | Output Stack | Operator Stack |
---|

##### Infix notation is a way of writing arithmetic expressions in which the operands (numbers) are written between the operator symbols. For example, the infix expression “2 + 3” means “add 2 and 3.”

On the other hand, postfix notation is a way of writing arithmetic expressions in which the operands are written after the operator symbols. The same expression “2 + 3” would be written as “2 3 +” in postfix notation.

## To convert an infix expression to postfix notation, you can use the following steps:

- Create an empty stack
- Start scanning the infix expression from left to right
- If the current character is an operand, append it to the result string
- If the current character is an operator, push it onto the stack
- If the current character is a left parentheses, push it onto the stack
- If the current character is a right parentheses, pop operators from the stack and append them to the result string until you reach a left parentheses. Discard the left and right parentheses.
- Repeat steps 2-6 until you have scanned the entire expression
- Pop any remaining operators from the stack and append them to the result string