package stack_queue; import org.junit.Test; import java.util.Stack; /** * @Author: wei1 * @Date: Create in 2018/12/2 16:55 * @Description: 1.这种逆波兰表达式,很明显,用栈求解。 * Evaluate the value of an arithmetic expression in Reverse Polish Notation. *
* Valid operators are+,-,*,/. Each operand may be an integer or another expression. *
* Some examples: *
* ["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9
* ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6
*/
public class EvalRPN {
public int evalRPN(String[] tokens) {
Stack