Problem Description:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Solution: 递归。 1 public List>...
分类:
其他好文 时间:
2014-07-07 16:59:12
阅读次数:
169
Problem Description:Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Solution: 1 public int maxPoint.....
分类:
其他好文 时间:
2014-07-07 16:55:19
阅读次数:
281
本题就是求所有连续子数列的和开始拿到题目还以为求的时数列子集的和,认真看到题目才知道是连续子数列循环遍历即可 int findSum(vector array) { int sum = 0; for(int i = 0 ; i < array.size(); ++...
分类:
其他好文 时间:
2014-07-07 16:10:42
阅读次数:
179
Problem Description:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf ...
分类:
其他好文 时间:
2014-07-07 16:01:34
阅读次数:
223
Problem Description:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below bina...
分类:
其他好文 时间:
2014-07-07 15:57:05
阅读次数:
252
having子句与where有类似之处但也有差别,都是设定条件的语句。在查询过程中聚合语句(sum,min,max,avg,count)要比having子句优先运行.而where子句在查询过程中运行优先级别优先于聚合语句(sum,min,max,avg,count)。简单说来:where子句:sel...
分类:
其他好文 时间:
2014-07-07 15:53:46
阅读次数:
236
Problem Description: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 ex...
分类:
其他好文 时间:
2014-07-07 15:29:11
阅读次数:
280
题目
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down...
分类:
其他好文 时间:
2014-06-30 11:10:34
阅读次数:
211
MYSQL中含有Blob字段是一件挺麻烦的事情,导出导入不方便。我介绍我是怎么做的。
1、在MYSQL的my.ini最后中添加一行配置max_allowed_packet = 100M,重启MYSQL服务
根据实际情况来定这个数值的大小,我这次表里面有82个mediumblob字段,所以设置为100M
2、用XML格式导出数据
3、选择用XML导入数据...
分类:
数据库 时间:
2014-06-30 09:42:21
阅读次数:
323
两个钥匙a,b是一对,隐含矛盾a->!b,b->!a
一个门上的两个钥匙a,b,隐含矛盾!a->b,!b->a(看数据不大,我是直接枚举水的,要打开当前门,没选a的话就一定要选b打开,没选b的话,就一定要选a打开)
#include
#include
#include
#include
#include
#include
using namespace std;
#define max...
分类:
其他好文 时间:
2014-06-30 09:41:26
阅读次数:
220