I’m trying to understand arithmetic using stacks. Specifically converting infix notation to postfix notation. My question is how you convert an expression like: **1 + (2 + 3) + (4 + 5)** that computes in the exact order that the order of operations says.

**Meaning: 1 + (2 + 3) + (4 + 5) becomes 1 + 5 + (4 + 5) then 1 + 5 + 9 then 6 + 9**

If you do:

**Push 1, Push 2, Push 3, Add, Push 4, Push 5, Add**

Where Add pops the top two operands off the stack, adds them, and then pushes the sum back on the stack.

Alternative notation: 1 2 3 + 4 5 +

How do you add 1 + (sum of 2 and 3) next? If you do another Add then the sum of 2 and 3 will be added to sum of 4 and 5, because these are the top two on the stack. **Is it impossible to do it in the exact same order? Doing each parentheses group first left to right then doing the rest of the computation left to right.**