Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST' ...
分类:
编程语言 时间:
2019-02-09 00:54:49
阅读次数:
183
重新学习MySQL数据库5:根据MySQL索引原理进行分析与优化 一:Mysql原理与慢查询 MySQL凭借着出色的性能、低廉的成本、丰富的资源,已经成为绝大多数互联网公司的首选关系型数据库。虽然性能出色,但所谓“好马配好鞍”,如何能够更好的使用它,已经成为开发工程师的必修课,我们经常会从职位描述上 ...
分类:
数据库 时间:
2019-02-08 21:46:26
阅读次数:
176
Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: 1 class Solution { 2 public: 3 vector<v ...
分类:
其他好文 时间:
2019-02-07 19:05:26
阅读次数:
151
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the ...
分类:
其他好文 时间:
2019-02-07 09:12:45
阅读次数:
175
题目意思就是找到第一个没有重复的数,数据只有10^5,所以用数组水了一下。如果比较大的话应该要用map和vector。 #include <iostream> #include <string.h> #define maxn 100005 int a[maxn],b[maxn]; int main( ...
分类:
其他好文 时间:
2019-02-06 12:00:09
阅读次数:
216
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Input: 2 Output: 91 Explanation: The answer shoul ...
分类:
其他好文 时间:
2019-02-05 23:49:45
阅读次数:
219
Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wak ...
分类:
编程语言 时间:
2019-02-05 22:33:22
阅读次数:
173
题目链接:https://www.luogu.org/problemnew/show/P3366 思路: 求最小生成树的模板题,求MST有两种算法——Prim、Kruskal。 两者区别:Prim在稠密图中比Kruskal优,在稀疏图中比Kruskal劣。Prim是以更新过的节点的连边找最小值,Kr ...
分类:
其他好文 时间:
2019-02-05 13:05:34
阅读次数:
229
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb ...
分类:
其他好文 时间:
2019-02-03 23:35:36
阅读次数:
165
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p ...
分类:
其他好文 时间:
2019-02-03 19:48:35
阅读次数:
208