Blog

Evaluation of reverse Polish notation

Problem Detail: We only consider the reverse Polish notation as an arithmetic expression. Formally, RNP is a sequence consisted of numbers and arithmetic operators: $+,-,*,/$, and its syntax is: $$newcommandRNF{mathrm{RNF}}newcommandnum{mathrm{number}}newcommandop{mathrm{operator}}RNF=num,bigvert,RNF,RNF,op$$ and its value $$newcommandeval{operatorname{eval}}evalnum=num$$ $$evalRNF_1,RNF_2,op=evalRNF_1 op evalRNF_2$$ The following pseudo code Read More …