The algorithm is:
- read the string from the last element to the first and put each element in a stack of Strings (each element of your stack will be a single char operator or a word convertible to a number).
- pop 3 elements convert the first two to a number and depending on the operator calculate the result
- push the result on the stack
- repeat 2) and 3) till the stack is empty.