- 博客(37)
- 收藏
- 关注
原创 刷题小记 (15) LeetCode 606 根据二叉树创建字符串
LeetCode 6062020.8.15我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { String str = ""; public St
2020-08-15 14:16:50
131
原创 刷题小记 (13) LeetCode 1038&538 从二叉搜索树到更大和树&把二叉搜索树转换为累加树
LeetCode 1038&538题小记
2020-08-15 09:00:21
109
原创 刷题小记 (11) LeetCode 111 二叉树的最小深度
LeetCode 1112020.8.14我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public int minDepth(TreeNode r
2020-08-14 19:39:16
118
原创 刷题小记 (10) LeetCode 235 二叉搜索树的最近公共祖先
LeetCode 2352020.8.14我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public TreeNode lowestCommonA
2020-08-14 16:14:26
96
原创 刷题小记 (9) LeetCode 563 二叉树的坡度
LeetCode 5632020.8.14我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public int findTilt(TreeNode r
2020-08-14 14:22:56
155
原创 刷题小记 (8) LeetCode 20 有效的括号 (括号匹配问题&栈)
LeetCode 202020.8.14今天的LeetCode每日一题我的通过代码class Solution { public boolean isValid(String s) { String[] xx = s.split(""); Stack<String> st = new Stack<String>(); boolean flag = true; for(int i=0;i<xx.len
2020-08-14 09:03:38
136
原创 刷题小记 (7) LeetCode 1367 二叉树中的列表
LeetCode 13672020.8.13我的通过代码/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } *//** * Definition for a binary tree node. * public class TreeNode { *
2020-08-13 16:03:09
127
原创 刷题小记 (6) LeetCode 700 二叉搜索树中的搜索
LeetCode 7002020.8.13我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public TreeNode searchBST(Tree
2020-08-13 14:28:03
67
原创 刷题小记 (5) LeetCode 404 左叶子之和
LeetCode 4042020.8.13我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public int sumOfLeftLeaves(Tre
2020-08-13 13:47:04
163
原创 刷题小记 (4) LeetCode 104 二叉树的最大深度
LeetCode 1042020.8.13我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public int maxDepth(TreeNode r
2020-08-13 12:25:24
102
原创 刷题小记 (3) LeetCode 101 对称二叉树 PLUS(Integer的比较)
LeetCode 1012020.8.12我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public boolean isSymmetric(Tre
2020-08-13 09:28:48
246
原创 刷题小记 (2) LeetCode 783&530 二叉搜索树节点最小距离&二叉搜索树的最小绝对差
LeetCode 783&5302020.8.12我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public int minDiffInBS
2020-08-12 10:52:35
117
原创 刷题小记 (1) LeetCode 257 二叉树的所有路径
LeetCode 2572020.8.12我的通过代码/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { public List<String> bina
2020-08-12 10:09:26
108
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人