Question: Mergeksorted linked lists and return
it as one sorted list. Analyze and describe its complexity.Solution: Find the
smallest list-head first....
分类:
其他好文 时间:
2014-06-10 19:51:30
阅读次数:
278
1 class Solution { 2 public: 3 int
singleNumber(int A[], int n) { 4 int bits = sizeof(int)*8; 5 int result=0; 6
for(int i...
分类:
移动开发 时间:
2014-06-10 19:45:48
阅读次数:
334
前中后遍历 递归版 1 /* Recursive solution */ 2 class
Solution { 3 public: 4 vector preorderTraversal(TreeNode *root) { 5 6 vector
resul...
分类:
其他好文 时间:
2014-06-10 19:38:03
阅读次数:
219
KK上全屏界面如何实现禁止状态栏下拉?[SOLUTION]Google从KK开始增加了状态栏透明以及全屏
界面有通知可以下拉状态栏的设计,而这个设计出现的隐患是设置了FULL_SCREEN的界面是无法禁止状态栏下拉的,这样对一些工程测试app可能会造
成一定的影响,但是以google默认的设计,应用...
分类:
其他好文 时间:
2014-06-10 17:06:52
阅读次数:
213
1 class Solution { 2 public: 3 int
singleNumber(int A[], int n) { 4 int i,j; 5 for(i=0; i<n; i++) 6 { 7 for(j...
分类:
移动开发 时间:
2014-06-10 11:41:55
阅读次数:
259
戳我去解题Write a function to find the longest
common prefix string amongst an array of strings.class Solution {public: string
longestCommonPrefix(vecto...
分类:
其他好文 时间:
2014-06-10 08:29:55
阅读次数:
189
The oldest solution that people still use for
this problem is select(). The select() call takes three sets of fds (implemented
as bit arrays): one for...
分类:
编程语言 时间:
2014-06-10 08:26:42
阅读次数:
325
定义 组合模式(Composite
Pattern)将对象组合成树形结构以表示“部分-整体”的层次结构,使得用户对单个对象和组合对象的使用具有一致性。组合模式也叫合成模式,有时又叫做部分——整体模式(Part-Whole),主要是用来描述部分与整体的关系。
组合模式跟数据结构中树的结构定义很相似,事...
分类:
其他好文 时间:
2014-06-10 08:22:12
阅读次数:
199
【前言】还是强调要少看题解。
【BZOJ1090】简单的区间DP。值得注意的是:在压缩的时候,如果是10个A压缩,那么化成(10)A后有5个字符而不是4个!(我在这里被坑了好长时间!)以下是核心代码:
for (len=2;len<=L;len++)
for (i=1;i<=L-len+1;i++)
{
j=i+len-1;
for (k=i;k<j;k...
分类:
其他好文 时间:
2014-06-10 07:08:27
阅读次数:
237