【leetcode】150.(Medium)Evaluate Reverse Polish Notation

解題思路: 使用棧 如果是數字入棧,如果是操作符取出棧中的top兩個數字進行操作再將結果入棧 提交代碼: class Solution { public int evalRPN(String[] tokens) { if(tokens.length==0) return 0; Stack<Integer> stack=new Stack<>
相關文章
相關標籤/搜索