过去只是人生经历,并不是人生负担[问题描述]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 bi...
分类:
其他好文 时间:
2014-10-07 13:47:03
阅读次数:
195
Problem Description
Jack and Jill play a game called "Leap Frog" in which they alternate turns jumping over each other. Both Jack and Jill can jump a maximum horizontal distance of 10 units in any ...
分类:
其他好文 时间:
2014-10-07 13:34:33
阅读次数:
152
/**
* Say you have an array for which the ith element is the price of a given stock on day i.
* Design an algorithm to find the maximum profit. You may complete as many transactions as you like
* ...
分类:
其他好文 时间:
2014-10-07 11:10:03
阅读次数:
129
初看好简单 一开始调试着一直re 后来也不知道怎么就对了 但是还有一些bug存在 ,
这道题的打印路径和light oj An Easy LCS(ps:点击打开链接)一样
但是只改一下会Tle 因为(1000*1000*1000)好大
但是把存储的字符串改为string 定义的就过了
但是还是有一点有点难受(下面会说出)
我也是醉了
#include
#include...
分类:
其他好文 时间:
2014-10-07 02:36:42
阅读次数:
405
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-10-07 00:32:12
阅读次数:
237
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-10-06 16:08:40
阅读次数:
181
LeetCode 新题又更新了,最大子数组乘积
题目分析:求一个数组,连续子数组的最大乘积。...
分类:
其他好文 时间:
2014-10-06 15:26:40
阅读次数:
175
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet...
分类:
其他好文 时间:
2014-10-06 14:52:50
阅读次数:
220
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 binary tree, 1 ...
分类:
其他好文 时间:
2014-10-05 23:13:59
阅读次数:
166
最长上升子序列LIS问题属于动态规划的初级问题,用纯动态规划的方法来求解的时间复杂度是O(n^2)。但是如果加上二叉搜索的方法,那么时间复杂度可以降到nlog(n)。 具体分析参考:http://blog.chinaunix.net/uid-26548237-id-3757779.html 代...
分类:
其他好文 时间:
2014-10-05 22:41:09
阅读次数:
194