Input: An expression I in Infix notation: e.g. a+(b+c)*d Output: Equivalent expression P in Postfix (Reverse Polish) notation: e.g. abc+d*+ 1. Initialize P to empty. Initialize a stack S to empty. 2. Read the symbols in I from left to right one at a time. 3. If an operand is found (number or variable), add it to P. 4. If a left parenthesis is found, push it into the stack S. 5. If an operator O is found, check the top of the Stack, then: 5.1 If the top of the stack is an operator with lower precedence than O or it is a left parenthesis, or S is empty, push O into the stack. 5.2 Otherwise, pop from the stack and add the operator to P. Then got to 5.1 and repeat. 6. If a right parenthesis is found, pop all the operators from S and add it to P one by one, until a left parenthesis is found in the stack. Remove the left parenthesis and continue. 7. When the input I has been scanned, pop all the remaining operators from S and add them to P one by one. End.