摘要:
第三次写了,一遍过/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(i... 阅读全文
摘要:
public class Solution { public int[] twoSum(int[] numbers, int target) { int left = 0; int right = numbers.length - 1; while (... 阅读全文
摘要:
public class Solution { private int result = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { helper(root); return result... 阅读全文
摘要:
public class Solution { public int minSubArrayLen(int s, int[] nums) { int p1 = 0; int p2 = 0; int length = nums.length; ... 阅读全文
摘要:
第一个是递归方法,第二个是非递归方法public class Solution { public boolean isSymmetric(TreeNode root) { if (root == null) { return true; } ... 阅读全文