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
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.
点击打开原题链接
这个题剑指offer里也有,简单的递归即可,代码很清晰:...
分类:
其他好文 时间:
2014-10-05 22:56:09
阅读次数:
185
题目:Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product. For example, g...
分类:
其他好文 时间:
2014-10-05 21:45:29
阅读次数:
198
最大似然估计是一种非常有效的参数估计的数学方法,常用于在主题建模等领域。其思想是,对于已知的样本,假设它服从某种模型,估计模型中未知的参数,使该模型出现这些样本的概率最大。...
分类:
其他好文 时间:
2014-10-05 15:26:18
阅读次数:
173
论文里面的神题,题意大概是找出当前字符串中的一个子串,使得这个子串由N个字符串循环构成,输出N最大的子串,如果有多输出字典序最小的一个。解决方法感觉很犀利。。首先,对于循环节长度为L的子串,必然有这个子串会经过str[0],str[L],str[2*L]...中的任意两个字符,也就是必然会经过str...
分类:
其他好文 时间:
2014-10-04 23:57:07
阅读次数:
319
Yaoge’s maximum profitTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 442Accepted Submission(s): ...
分类:
其他好文 时间:
2014-10-04 13:04:46
阅读次数:
246