https://leetcode cn.com/problems/minimum number of flips to convert binary matrix to zero matrix/ DFS ...
分类:
其他好文 时间:
2020-04-02 22:23:49
阅读次数:
83
问题: 1.什么是依赖倒置? 2.什么是控制反转? 3.什么是依赖注入? 4.它们之间的关系是怎样的? 5.优点有哪些? 带着上面的5个问题,我们开始今天的学习。 依赖倒置原则 (Dependency Inversion Principle) 依赖倒置是一种设计原则。 依赖倒置包括三层含义: (1) ...
分类:
编程语言 时间:
2020-04-01 12:37:32
阅读次数:
103
题意:在二叉查找树中查找两个节点之差的最小绝对值 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x ...
分类:
其他好文 时间:
2020-04-01 00:56:06
阅读次数:
75
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov ...
分类:
其他好文 时间:
2020-03-31 22:46:01
阅读次数:
62
题目描述 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations pe ...
分类:
其他好文 时间:
2020-03-31 18:48:00
阅读次数:
81
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在nu ...
分类:
数据库 时间:
2020-03-31 10:26:46
阅读次数:
74
要求 给定一个含有 n 个正整数的数组和一个正整数 s 找出该数组中满足其和 ≥ s 的长度最小的连续子数组 如果不存在符合条件的连续子数组,返回 0 示例 输入:s = 7, nums = [2,3,1,2,4,3] 输出:2 解释:子数组 [4,3] 是该条件下的长度最小的连续子数组 思路 暴力 ...
分类:
其他好文 时间:
2020-03-30 09:40:08
阅读次数:
94
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor ...
分类:
其他好文 时间:
2020-03-29 12:34:44
阅读次数:
57
给定一个单词列表,我们将这个列表编码成一个索引字符串 S 与一个索引列表 A。 例如,如果这个列表是 ["time", "me", "bell"],我们就可以将其表示为 S = "time#bell#" 和 indexes = [0, 2, 5]。 对于每一个索引,我们可以通过从字符串 S 中索引的 ...
分类:
其他好文 时间:
2020-03-28 23:26:27
阅读次数:
73
介绍了Trie树(又称字典树、单词查找树、前缀树)的C++实现和LeetCode上实例。 ...
分类:
编程语言 时间:
2020-03-28 17:54:10
阅读次数:
67