Excuse me for the newbish question in advance but how should I make sure I don't make a mistake converting from RPN to infix notation when I don't know if some of the numbers aren't two-digit ones or when I do that some are but I don't know which ones? For example, how do I know if I should evaluate $112+$ to $11+2$ or $1+12$? Or such thing is impossible to evaluate when I don't know where the enters were put in?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
You have to know where the breaks are (where the user pressed enter). In RPN, you put one number on the stack, put a second number in the next spot on the stack, and then do an operation on those two numbers. If you don't know the contents of each position in the stack (i.e., you don't know if 112 is 11 in one position and 2 in the other or 1 in one position and 12 in the other) then you can't evaluate it.