Stack特点:
先入后出(FILO)
Stack常见的创建方式:
Stack<Character> stack = new Stack<>()
Stack常见操作:
stack.size()
stack.isEmpty() stack.push(val) stack.pop() //在该操作前,确保 !stack.isEmpty() stack.peek()
Stack高频题:
[leetcode]20. Valid Parentheses有效括号序列
程序媛詹妮弗
终身学习 |
先入后出(FILO)
Stack<Character> stack = new Stack<>()
stack.size()
stack.isEmpty() stack.push(val) stack.pop() //在该操作前,确保 !stack.isEmpty() stack.peek()
[leetcode]20. Valid Parentheses有效括号序列