摘要: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb... 阅读全文
posted @ 2014-09-05 15:48 山是水的故事 阅读(105) 评论(0) 推荐(0) 编辑
摘要: bool helper(TreeNode *pA, TreeNode *pB) { if (!pA && !pB) return true; if (!pA || !pB) return false; // only one has node in a tree and... 阅读全文
posted @ 2014-09-04 22:06 山是水的故事 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2014-09-04 21:27 山是水的故事 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni... 阅读全文
posted @ 2014-09-04 17:45 山是水的故事 阅读(319) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2014-09-04 15:15 山是水的故事 阅读(618) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2014-09-04 14:14 山是水的故事 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 由于项目的需要,我们需要连接许多类型的数据库。同时我们希望对数据库的操作能够提供一个统一的访问接口。现在网上有不少开源的,但是对于用惯了VC ADO的人来说,这些接口设计的感觉真是有点反人类。比较好用的有一个人SQLAPI++,但是是要收费的,破解版的也没有源代码,那种代码无法掌握在自己手里的感觉,总是感觉不爽。于是便自己开始写一个。 根据初步的设计,有了以下的一个模型: ... 阅读全文
posted @ 2013-01-26 16:30 山是水的故事 阅读(2574) 评论(2) 推荐(0) 编辑