i was reading stack and i came across the infix, preifx and postfix expression.So i understood that why postfix /prefix expressions are preferred over infix expression ( due to its unambiguous nature) .But i am not getting any enough information about the popularity reason of postifx expression over prefix expression.

Why are we not using prefix expression than the postfix expression more often?

I am guessing that ,

  1. it's related to the easiness of converting the infix to postfix
  2. or the evaulation process of postifx is easy than prefix.

If so, Please someone elaborate on it.


  • 1
    $\begingroup$ Functional programming languages use prefix. $\endgroup$ Commented Mar 25, 2020 at 17:45
  • 2
    $\begingroup$ The only reason I am aware of is, "because HP made a bunch of calculators that used postfix notation." $\endgroup$ Commented Mar 25, 2020 at 17:48

1 Answer 1


The evaluation is easier for postfix-notation expressions.

The evaluation is done easily using a stack. The expression is processed from left to right, one token at a time:

  • operand -> put it on the stack;
  • operator -> get from the stack the number of values it needs (two for +, three for ?:, one for unary - and so on), combine the values using the operator and put the result on the stack.
  • when the entire expression is processed, the stack contains only one value; it is the value of the entire expression.

The prefix-notation expressions can be evaluated using a similar algorithm that uses the operands (instead of the operators) to trigger computations. However, it is not that straight-forward; it involves lookups on the top of the stack to find the operator and to decide if enough operands were read for it.

The prefix-notation expressions can also be evaluated from right to left using the same algorithm as for postfix-notation expressions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.