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 and sum
= 22,
5
/ ...
分类:
其他好文 时间:
2014-10-02 18:25:03
阅读次数:
153
[leetcode]Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring....
分类:
其他好文 时间:
2014-10-02 13:30:42
阅读次数:
217
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
面DP题的考官都是神经病。。(吐...
分类:
其他好文 时间:
2014-10-01 13:15:31
阅读次数:
242
题目地址:Paths on a Grid题目大意: 给你一个矩形的格子,让你从左下角走到右上角,每次移动只能向上或者向右,问你有多少种可能的路径。解题思路: 水题,排列组合。推出公式C(m+n,较小的那个数)代码: 1 #include 2 #include 3 #include 4 #i...
分类:
其他好文 时间:
2014-09-30 23:20:30
阅读次数:
197
本文介绍的STL算法中的remove删除算法,源码中介绍了函数remove、remove_copy、remove_if、remove_copy_if、unique、unique_copy。并对这些函数的源码进行详细的剖析,并适当给出使用例子。...
分类:
其他好文 时间:
2014-09-30 22:59:30
阅读次数:
351
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-09-30 17:19:19
阅读次数:
173
The feeling of depending on oneself and AC is just great. 1 #include 2 #include 3 using namespace std; 4 class Solution { 5 public: 6 int unique...
分类:
其他好文 时间:
2014-09-30 13:02:29
阅读次数:
190
How Many Paths Are ThereTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:319164-bit integer IO format:%I64d Java ...
分类:
其他好文 时间:
2014-09-30 02:49:21
阅读次数:
318
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.
去网上搜n个二叉搜索树的递推公式或者Catalan数,可以由h(n)=C(2n,n)/(n+1)得到h(n)=[2n*(2n-1)*...(n+2)]/[n!]....
分类:
其他好文 时间:
2014-09-29 17:57:01
阅读次数:
171
PD中建CDM模型,一个Diagram中有两张表,字段不能重复? 工具-model options-model settings 去掉data item 下的unique code 还有一个"Allow reuse"复选框,建议把这个钩也去掉,那么以后就不要担心在模型里发生...
分类:
其他好文 时间:
2014-09-29 11:36:11
阅读次数:
392