Polish reverse write can too you
Suffix notation (also known as Lukasiewicz or reverse Polish notation) is a notation for arithmetic expressions that places the operands before the operator that uses them. This allows the expression to be written without parentheses. If the expression is evaluated in left-to-right order, the computed values of an operator's operands are available when that operand is encountered.
An arithmetic expression in parenthesized (infix) form can be converted to reverse Polish by converting the operations from left to right, so
(a+(b/c) )-(d*e*f)
can be converted to
abc/+de*f*- and when evaluated both forms produce the partial results
b/c
a+(b/c)
d*e
d*e*f
and the final result (a+(b/c) )-(d*e*f).
Operators that represent both a monadic and a dyadic operation (such as "minus") must have an alternate way of expressing one of the operations. For example, -x can be represented as 0x- (infix 0-x).
0 Comments:
Post a Comment
Please enter your comment here. Comments wil be reviewed before being published.
Subscribe to Post Comments [Atom]
<< Home