【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to...
分类:
其他好文 时间:
2014-06-08 17:52:45
阅读次数:
235
题目
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's.
1 3 3 2 ...
分类:
其他好文 时间:
2014-06-08 17:06:58
阅读次数:
235
题目:For example,"A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome.
解题思路:验证一个字符串是否是回文字符串。首先看看wiki上对于回文的解释:回文,亦称回环,是正读反读都能读通的句子,亦有将文字排列成圆圈者,Famous examples include "Amore, Roma", "A man, a plan, a canal: Panama" and "No 'x' in...
分类:
其他好文 时间:
2014-06-08 16:30:29
阅读次数:
235
QT中很多类都实现了隐含共享例如QString,QByteArray等,(这两个并没有使用QSharedData和QSharedDataPointer来实现隐含共享),但是QT的确提供了一套隐含共享机制的类QSharedData和QSharedDataPointer。核心原理是隐含共享数据指针(QSharedDataPointer重载->操作来控制所有对QSharedData数据对象的访问,确保统...
分类:
其他好文 时间:
2014-06-08 15:52:37
阅读次数:
302
题目
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 shown below.
...
分类:
其他好文 时间:
2014-06-08 15:15:26
阅读次数:
223
题目:For example, given s = "aab",
Return 1 since the palindrome partitioning ["aa","b"] could be produced using 1 cut
解题思路:给一个字符串,如果字符串可以划分成若干子回文字符串,返回最小的划分数量。
这个题如果还用之前求所有划分组合的循环加递归方法的话,就会得到超时的错误。这是就要考虑别的方法,动态规划倒是一个不错的方法,但是动态规划最重要的是要找到动态方程。本题的动态方程:
dp[i] =...
分类:
其他好文 时间:
2014-06-08 14:56:58
阅读次数:
257
在上一篇文章,《Qt on Android:QML 语言基础》中,我们介绍了 QML 语言的语法,在最后我们遗留了一些问题没有展开,这篇呢,我们就正式开始撰写 Qt Quick 程序,而那些问题,随着本系列文章的展开也会一一被干掉。...
分类:
移动开发 时间:
2014-06-08 10:48:54
阅读次数:
396
题目
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.3...
分类:
其他好文 时间:
2014-06-08 10:37:47
阅读次数:
273
MainActivity如下:
package com.example.ttt;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Window;
/**
* Demo描述:
* 改变系统自带ProgressDialog的...
分类:
其他好文 时间:
2014-06-08 09:24:15
阅读次数:
190
题目
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadb...
分类:
其他好文 时间:
2014-06-08 09:14:26
阅读次数:
215