The Beastie Forums

Full Version: Task 3 postfix output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the example provided in task 3's description, the infix expression

(2 + 3 * x ^ 5 + a)

is given as

(2 3 x 5 ^ * a + +)

when written in postfix notation. However, the directions also state

"Note that all operators are left associative."

From my understanding of associativity, it seems that 2 + [3*x^5] should be evaluated first, instead of [3*x^5] + a, yielding a correct postfix representation of

(2 3 x 5 ^ * + a +)
^ you are correct. The assignment sheet has be amended.