Talk:Parsing/RPN to infix conversion: Difference between revisions

m
m (→‎Examples Incorrect: back to draft?)
Line 13:
:::: I added an extra example, now sadly all the tasks are wrong (although I think a couple already address this). The task already requires the RPN and infix to be the same. One thing, I can't find the template that says (globally) the task changed. So I'll have to mark them all incorrect if I can't find one. --[[User:Dgamey|Dgamey]] 16:49, 17 December 2011 (UTC)
:: Huh, if you want minimum parentheses and follow the [[wp:Associativity|actual definition]] of associativity, the task itself is incorrect: - and / are non-associative. The term "left-associative" is often loosely used when parsing infix notations, to determine the order of ops in absence of parens, but to do the reverse and requiring minimum number of parens, this kind of definition of associativity is not enough, and you need to know the exact behaviour of the operators (a + b + c requires none, but a - b - c may need one pair, even though both + and - are both loosely "left associative"). The task needs some more work, or there may be other holes after people try to fix the solutions. --[[User:Ledrug|Ledrug]] 17:50, 17 December 2011 (UTC)
::: I didn't write it, I just noticed it was broken. Perhaps it should be knocked back to draft. By adding the extra example in a table other examples could be added easily. Although for output, perhaps suppressing the detail for all but one case would be appropriate. --[[User:Dgamey|Dgamey]] 18:1920, 17 December 2011 (UTC)
:::: SorryBy Iadding thoughtthe whatextra youexample werein talkinga abouttable isother ifexamples ancould operatorbe isadded easily. Although for output, perhaps suppressing the detail for all but one case would be appropriate. commutative? --[[User:Dgamey|Dgamey]] 18:19, 17 December 2011 (UTC)
::: Sorry I thought what you were talking about is if an operator is commutative? --[[User:Dgamey|Dgamey]] 18:19, 17 December 2011 (UTC)
 
== New Input examples ==
Anonymous user