Fork me on github
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页
摘要: 递增顺序搜索树 https://leetcode-cn.com/problems/increasing-order-search-tree/ 思路: 中序遍历,处理根节点的时候,重新构建新树 public class Solution { TreeNode p = new TreeNode(0); 阅读全文
posted @ 2021-04-25 10:16 zjy4fun 阅读(40) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/guo_ridgepole/article/details/108257277 阅读全文
posted @ 2020-08-29 11:08 zjy4fun 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 回溯,全局变量 import java.util.ArrayList; import java.util.List; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode le 阅读全文
posted @ 2020-08-26 23:04 zjy4fun 阅读(104) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; /* 层次遍历的变形 */ class Solution { public List<List<Integer>> zigzagLevelOrder(TreeNode root) { List<List<Integer>> res = new ArrayLis 阅读全文
posted @ 2020-08-26 22:25 zjy4fun 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 思路:找序列中最小的那个数字,然后递增检查。 import java.util.HashSet; import java.util.Set; class Solution { public int longestConsecutive(int[] nums) { Set<Integer> set = 阅读全文
posted @ 2020-08-26 21:22 zjy4fun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } * 阅读全文
posted @ 2020-08-26 21:15 zjy4fun 阅读(92) 评论(0) 推荐(0) 编辑
摘要: /* * @lc app=leetcode.cn id=33 lang=java * * [33] 搜索旋转排序数组 */ // @lc code=start class Solution { public int search(int[] nums, int target) { int left 阅读全文
posted @ 2020-08-25 20:21 zjy4fun 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 打开网站 https://shields.io/ 看到下面的界面 填写信息后生成徽标图片 这样就可以在 MarkDown 中引入该图片 如果想要给该图片附上一个超链接,可以这样写 [![](https://img.shields.io/badge/star-1k-red)](www.baidu.co 阅读全文
posted @ 2020-08-25 10:37 zjy4fun 阅读(310) 评论(0) 推荐(0) 编辑
摘要: /* * @lc app=leetcode.cn id=105 lang=java * * [105] 从前序与中序遍历序列构造二叉树 */ // @lc code=start /** * Definition for a binary tree node. * public class TreeN 阅读全文
posted @ 2020-08-24 23:58 zjy4fun 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 第一题:圆形赛道上经过次数最多的扇区 import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Solution { public List<Integer> mostVisited(int n 阅读全文
posted @ 2020-08-23 21:12 zjy4fun 阅读(71) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页