Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, * , /. Each operand may be an integer or another expression.
Examples
1 2 |
|
Solution
- Use Stack
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, * , /. Each operand may be an integer or another expression.
1 2 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|