题目: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.
思路:题目要求的s的一个最长回...
分类:
编程语言 时间:
2015-01-15 23:54:08
阅读次数:
207
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2015-01-15 23:20:18
阅读次数:
194
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest...
分类:
其他好文 时间:
2015-01-15 22:12:45
阅读次数:
169
写JS的时候,一不注意就方法递归死循环了。
下面是错误截图:
找到对应代码 ,处理下即可!...
分类:
其他好文 时间:
2015-01-15 13:02:24
阅读次数:
269
题目:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the l...
分类:
编程语言 时间:
2015-01-15 13:02:10
阅读次数:
229
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:
其他好文 时间:
2015-01-15 12:34:54
阅读次数:
111
Maximum sumTime Limit:1000MSMemory Limit:65536KTotal Submissions:34398Accepted:10661DescriptionGiven a set of n integers: A={a1, a2,..., an}, we defin...
分类:
其他好文 时间:
2015-01-15 12:20:16
阅读次数:
163
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 (ie, buy on...
分类:
其他好文 时间:
2015-01-15 09:27:56
阅读次数:
187
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...
分类:
其他好文 时间:
2015-01-14 16:44:41
阅读次数:
109
红黑树是建立在二叉查找树的基础之上的,关于二叉查找树可以参看【算法导论】二叉搜索树的插入和删除和【算法导论】二叉树的前中后序非递归遍历实现。对于高度为h的二叉查找树而言,它的SEARCH、INSERT、DELETE、MINIMUM、MAXIMUM等操作的时间复杂度均为O(h)。所以在二叉查找树的高度较高时,上述操作会比较费时,而红黑树就可以解决这种问题。...
分类:
编程语言 时间:
2015-01-14 12:49:51
阅读次数:
1480