摘要:
今天结束了二叉树的学习, 开始新的一章了 77.组合 class Solution { List<List<Integer>> res = new ArrayList<List<Integer>>(); List<Integer> list = new ArrayList<Integer>(); p 阅读全文
摘要:
今天是第二十一天,还是二叉树,做了得有一周的二叉树了 530.二叉搜索树的最小绝对差 class Solution { int res = Integer.MAX_VALUE; TreeNode pre = null; public int getMinimumDifference(TreeNode 阅读全文
摘要:
今天还是二叉树 654. 最大二叉树 class Solution { public TreeNode constructMaximumBinaryTree(int[] nums) { int n = nums.length; return maxTree(nums, 0, n - 1); } pu 阅读全文
摘要:
今天是本周二叉树的最后一章了,内容都是偏难的 513.找树左下角的值 class Solution { public int findBottomLeftValue(TreeNode root) { Queue<TreeNode> q = new LinkedList<>(); q.offer(ro 阅读全文
摘要:
今天是训练营的第十五天,继续二叉树方面的学习 迭代法遍历: 前序: class Solution { public List<Integer> preorderTraversal(TreeNode root) { Stack<TreeNode> s = new Stack<>(); List<Int 阅读全文
摘要:
今天是第十四天,除了二叉树的基本概念外,还有递归法的应用 144. 二叉树的前序遍历 class Solution { public List<Integer> preorderTraversal(TreeNode root) { List<Integer> res = new ArrayList< 阅读全文