3 ms·
When the expression is interpreted, not compiled, postfix has the advantage that you only need to memorize the yet unused operands. With prefix, you have to me
by adrian_b 2y ago
When the expression is interpreted, not compiled, postfix has the advantage that you only need to memorize the yet unused operands.
With prefix, you have to memorize also the yet not executed operations and for each operation you need to memorize how many operands have already been provided for it, in order to execute the operation as soon as its last operand has been provided.
So for a compiled language it does not matter much whether an expression is written with prefix notation or with postfix notation, but for an interpreted language the latter is more efficient.