The algorithm for evaluating any postfix expression is fairly straightforward: While there are input tokens left Read the next token from input. If the token is a value Push it onto the stack. Otherwise, the token is an operator (operator here includes both operators and functions). It is kn...
Notation),如:"+ - A * B C D",转换成中缀表达式为:"A - B * C + D";后缀表达式(Postfix Notation),比如前所述的中缀表达式转换为后缀表达式为:"A B C * - D +"。为了纪念波兰数学家鲁卡谢维奇(Jan Lukasiewicz),前缀表达式被称作波兰表达式,后缀表达式称为逆波兰表达式(Reverse Polish Notation)。