【题目】
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
an...
分类:
其他好文 时间:
2014-12-17 12:49:36
阅读次数:
140
这道题承接Unique Binary Search Trees,只需要返回搜索二叉树的个数,用DP求解。但是这道题需要得到所有树的集合,可以用DFS求解。
原题是这个样子的:
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's...
分类:
其他好文 时间:
2014-12-17 00:23:26
阅读次数:
191
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum...
分类:
其他好文 时间:
2014-12-16 16:39:06
阅读次数:
264
【Combination Sum I】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be cho...
分类:
其他好文 时间:
2014-12-16 11:45:46
阅读次数:
186
排序操作排序是计算机承担的最基本操作之一,尤其是在数据库处理领域,oracle也不例外。可能需要oracle排序数据的操作包括以下几种;(1)创建一个索引(2)通过groupby,unique或distinct关键字对数据进行分组或聚合(3)因为使用orderby子句使得数据按照排好的顺序返回(4)..
分类:
编程语言 时间:
2014-12-15 22:00:31
阅读次数:
387
在上次中,我们说到"唯一非聚集索引"和“非唯一非聚集索引”在存储上有一个明显的差别:唯一非聚集索引的非叶子节点上不会包含RID的数据,让我们继续来深挖一下。准备测试数据:CREATE TABLE TB1( C1 INT, C2 INT, C3 INT)GOCREATE UNIQUE...
分类:
其他好文 时间:
2014-12-15 01:24:41
阅读次数:
203
题目:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. ...
分类:
其他好文 时间:
2014-12-14 18:30:16
阅读次数:
176
主要是边界1和,里面1赋值的问题了。 方法还是I的方法 这里突然忘了,二维数组如何得到x,y了 public int uniquePath(int[][] obstacleGrid){
int m=obstacleGrid.length;
int n=obstacleGrid[0].length;
...
分类:
其他好文 时间:
2014-12-14 14:42:27
阅读次数:
121
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-12-14 00:38:30
阅读次数:
161