Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-08-13 14:39:26
阅读次数:
153
题目:uva10564 - Paths through the Hourglass(递推)
题目大意:给出这样的两个数塔,然后给出一个值,问你能否从这个数塔中找到路径,路径上的值之和等于这个数,输出这样的路径的总数,如果多条打印路径先挑开始的位置(0..n - 1)最小的,如果这样还是有多条,在比较后面的向左向右字典序最小的。
解题思路:一开始两个数塔一个正着推,一个倒着推,结...
分类:
其他好文 时间:
2014-08-13 01:14:25
阅读次数:
302
在model中定义public function rules(){ return array( array('Name,Email','required'), array('Email','unique','message'=>'{value...
分类:
其他好文 时间:
2014-08-12 18:31:14
阅读次数:
199
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2014-08-12 16:40:14
阅读次数:
157
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example, [1,1,2] have the following unique pe...
分类:
其他好文 时间:
2014-08-12 10:17:03
阅读次数:
142
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic...
分类:
其他好文 时间:
2014-08-12 00:12:03
阅读次数:
209
The Unique MSTTime Limit:1000MSMemory Limit:10000KTotal Submissions:20430Accepted:7186DescriptionGiven a connected undirected graph, tell if its minim...
分类:
其他好文 时间:
2014-08-12 00:09:23
阅读次数:
273
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:
其他好文 时间:
2014-08-11 23:52:23
阅读次数:
209
SQL 约束解说2009-04-27 09:29约束主要包含:NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY CHECK DEFAULT 1、not null :用于控制字段的内容一定不能为空(NULL)。 使用方法 :Create table MyTable ( i...
分类:
数据库 时间:
2014-08-11 20:55:42
阅读次数:
270
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have
the following unique permutations:
[1,1,2], [1,2,1],
and [2,1...
分类:
其他好文 时间:
2014-08-11 17:49:32
阅读次数:
201