Infix Expression VS Postfix Expression

作者:Sys Admin 浏览(190) 评论(0)

1+2*(3-1)/5+6,

Given such a infix expression, to calculate the result, it's easier to first convert it into postfix expression.

In equal postfix expression, operands are placed in order, and following operators are in the priority decreasing order, and brackets is a unit of operands+operators combination.

So, next when calculating the result, there is no brackets and no need to care about priority.

没有登录不能评论