题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each numb...
分类:
其他好文 时间:
2014-10-26 06:43:06
阅读次数:
171
问题描述:
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
import java.util.Arr...
分类:
其他好文 时间:
2014-10-25 21:28:57
阅读次数:
205
//冒泡排序法#includeusing namespace std;int main (){ int i,j,t,ii; int a[11]; //第0个元素始终没有用 cout>a[i]; //输入a[1]~a[10] } cout<<e...
分类:
编程语言 时间:
2014-10-25 19:58:03
阅读次数:
284
Part I:提问===========================1.Part II:Contoso大学校园管理系统案例练习===========================2.演练5-5:Contoso大学校园管理系统5
分类:
其他好文 时间:
2014-10-25 18:44:41
阅读次数:
124
这道题是Search in Rotated Sorted Array的扩展,思路在Find Minimum in Rotated Sorted Array中已经介绍过了,和Find Minimum in Rotated Sorted Array唯一的区别是这道题目中元素会有重复的情况出现。不过正是因为这个条件的出现,影响到了算法的时间复杂度。原来我们是依靠中间和边缘元素的大小关系,来判断哪一半是不...
分类:
其他好文 时间:
2014-10-25 08:10:07
阅读次数:
206
Find Minimum in Rotated Sorted Array II Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-...
分类:
其他好文 时间:
2014-10-24 20:42:30
阅读次数:
299
这道题跟Pascal's Triangle很类似,只是这里只需要求出某一行的结果。...
分类:
其他好文 时间:
2014-10-24 19:01:21
阅读次数:
233
经典题目,杨辉三角,输入行数,生成杨辉三角的数组...
分类:
其他好文 时间:
2014-10-24 16:42:49
阅读次数:
176
UVA10869 - Brownie Points II(线段树)
题目链接
题目大意:平面上有n个点,Stan和Ollie在玩游戏,游戏规则是:Stan先画一条竖直的线作为y轴,条件是必须要经过这个平面上的某一点,而ollie则画x轴,但是要在Stany画的y轴上经过的点中任意选择一点来作为原点画x轴。然后这个平面就被划分为4个象限,轴上的点都不算,1,3象限的点的个数就是Stan的...
分类:
其他好文 时间:
2014-10-24 16:39:47
阅读次数:
219
今早起来做 LeetCode,结果被这道题卡了将近1个半小时,忍着没有去搜答案,最后还是被我想出来了,而且直接一次AC,哈哈!现在在这里记录一下解题思路。原题:Givenn, generate all structurally uniqueBST's(binary search trees) t.....
分类:
其他好文 时间:
2014-10-24 15:57:21
阅读次数:
202