题目:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to ....
分类:
编程语言 时间:
2014-08-03 05:24:06
阅读次数:
304
做leetcode第二题的时候,发现合并有序数组是一个很有意思的问题,于是,总结如下,部分内容来源于网络各位大神.
第一种方法:
合并调用sort.
即是将两个数组合并在一个数组里面,然后对合并后的数组调用sort函数即可.
class Solution:
def getArray(self, A, B) :
for item in B :
...
分类:
其他好文 时间:
2014-08-02 21:02:14
阅读次数:
259
无源汇可行流弧流量限制条件 b(u,v)<=f(u,v)<=c(u,v),(u,v)∈E不妨设f(u,v)=b(u,v)+f1(u,v),Σ( b(u,v)+f1(u,v) ) = Σ( b(v,w)+f1(v,w) )Σ b(u,v) - Σ b(v,w) = Σf1(v,w) -Σf1(u,v)...
分类:
其他好文 时间:
2014-08-02 17:59:23
阅读次数:
180
Description
Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ..., and place N chessmen on different grid...
分类:
其他好文 时间:
2014-08-02 12:56:13
阅读次数:
312
Single Number II
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?...
分类:
其他好文 时间:
2014-08-02 12:53:53
阅读次数:
289
edgesForExtendedLayout是一个类型为UIExtendedEdge的属性,指定边缘要延伸的方向。因为iOS7鼓励全屏布局,它的默认值很自然地是UIRectEdgeAll,四周边缘均延伸,就是说,如果即使视图中上有navigationBar,下有tabBar,那么视图仍会延伸覆盖到四...
分类:
移动开发 时间:
2014-08-02 12:34:43
阅读次数:
222
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For exa...
分类:
其他好文 时间:
2014-08-01 23:18:42
阅读次数:
246
jquery.data()文档:http://api.jquery.com/jQuery.data/html5有个data-*属性,跟这个功能一样。Note:This is a low-level method; a more convenient.data()is also available.T...
分类:
Web程序 时间:
2014-08-01 22:43:22
阅读次数:
351
AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.编程珠玑中的一道题,书中的解法很巧妙,我就直接搬来用了,时...
分类:
其他好文 时间:
2014-08-01 22:37:32
阅读次数:
162