I am testing the infix-to-postfix-to-infix converter and have detected some uncertainty. For example, a simple infix sum
1 + 2 + 3 + 4
can be converted to postfix
1 2 + 3 + 4 +
assuming operators with the same priority do not accumulate. If they are then, I get
1 2 3 4 + + +
On the other hand, all subsequent postfix expressions can be converted to the initial sum
1 2 + 3 + 4 +
1 2 + 3 4 + +
1 2 3 4 + + +
Are all these postfix expressions correct?
Update1
If you made such a converter, in what form would you choose? I need to choose one for testing.
source
share