摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2020-12-15 17:06 peanut_zh 阅读(66) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean verifyPostorder(int[] postorder) { return verifySquenceofBST(postorder,0,postorder.length-1); } boolean verifySquenceo 阅读全文
posted @ 2020-12-15 16:30 peanut_zh 阅读(90) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2020-12-15 15:30 peanut_zh 阅读(93) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2020-12-15 15:01 peanut_zh 阅读(78) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.Queue; import java.util.LinkedList; /** public class TreeNode { int val = 0; TreeNode left = null; TreeNo 阅读全文
posted @ 2020-12-15 14:51 peanut_zh 阅读(77) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean validateStackSequences(int[] pushed, int[] popped) { Stack<Integer> stack = new Stack<>(); int index = 0; for(int x : 阅读全文
posted @ 2020-12-15 12:20 peanut_zh 阅读(70) 评论(0) 推荐(0) 编辑