待整理https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/solution/you-xu-ju-zhen-zhong-di-kxiao-de-yuan-su-by-leetco/ ...
分类:
其他好文 时间:
2020-07-07 17:56:02
阅读次数:
62
链接:https://leetcode-cn.com/problems/insert-interval/ 代码 class Solution { public: vector<vector<int>> insert(vector<vector<int>>& a, vector<int>& b) { ...
分类:
其他好文 时间:
2020-07-07 17:43:06
阅读次数:
56
Description 传送门 Solution 注意到$DFS$的时候每次选择一个$DFS$树的子树后必然会走所有子树中的节点,所以原问题变成所有子树内的顺序乘子树外的顺序。 这样可以将还没有经过的节点状压,进行记忆化搜索。$DFS$树的子树个数就是去掉当前点之后的连通块个数,用并查集维护即可。 ...
分类:
其他好文 时间:
2020-07-07 13:32:39
阅读次数:
62
1.两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 给定 nums = [2, 7, 11, 15], target = 9 ...
分类:
其他好文 时间:
2020-07-07 13:12:43
阅读次数:
39
题目来源:leetcode226 翻转二叉树 题目描述: 翻转一棵二叉树。 解题思路 递归 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *ri ...
分类:
其他好文 时间:
2020-07-07 10:00:25
阅读次数:
51
yum update kernelyum update kernel-develyum update kernel-firmwareyum update kernel-headersyum update nss-utilyum update nssyum update nss-sysinityum ...
分类:
其他好文 时间:
2020-07-07 09:51:52
阅读次数:
84
给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和。 说明: 叶子节点是指没有子节点的节点。 示例: 给定如下二叉树,以及目标和 sum = 22, 返回 true, 因为存在目标和为 22 的根节点到叶子节点的路径 5->4->11->2。 来 ...
分类:
其他好文 时间:
2020-07-07 09:37:41
阅读次数:
50
链接:https://leetcode-cn.com/problems/jump-game-ii/ 代码 class Solution { public: int jump(vector<int>& nums) { int n = nums.size(); vector<int> f(n); for ...
分类:
其他好文 时间:
2020-07-07 09:32:36
阅读次数:
49
链接:https://leetcode-cn.com/problems/combination-sum-ii/ 代码(dfs) class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int> ...
分类:
其他好文 时间:
2020-07-06 16:42:37
阅读次数:
50
链接:https://leetcode-cn.com/problems/combination-sum/ 代码(dfs) class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> c ...
分类:
其他好文 时间:
2020-07-06 16:29:07
阅读次数:
61