3 ms·
^ ^ 2 3 4 Prefix notation doesn't automatically solve the problem, you need to assume an evaluation order. More specifically, you need to not assume associativ
by sesqu 15y ago
^ ^ 2 3 4
Prefix notation doesn't automatically solve the problem, you need to assume an evaluation order. More specifically, you need to not assume associativity.
- baddox 15y agoIsn't the lack of associativity explicit in prefix notation? Prefix notation doesn't even contain the notion of order of operations. You would convert the infix "2^3^4" to prefix in different ways depending on the associativity of exponentiation: For left associativity (uncommon): ^ ^ 2 3 4 For right associativity (common): ^ 2 ^ 3 4 Of course, all this is assuming all operators are fixed arity, otherwise you need parentheses no matter what.