Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.找树的最大路径和 注意路径可以从任意点起始和结束。我发现我真的还挺擅长树的题目的,递归不难。就是因为有个...
分类:
其他好文 时间:
2014-11-27 23:24:02
阅读次数:
284
题意:
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 one and sell one share of the stock multiple ti...
分类:
其他好文 时间:
2014-11-27 20:36:25
阅读次数:
215
Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be...
分类:
其他好文 时间:
2014-11-27 20:22:01
阅读次数:
181
在mysql用phpMyAdmin导入大数据的时候出现:Fatal error: Maximum execution time of 300 seconds exceeded in D:/查了很多文章都说是把php.ini里面的max_execution_time改大就可以,可我改了还是不行,后来查...
分类:
Web程序 时间:
2014-11-27 18:20:02
阅读次数:
282
要求:求二叉树的深度(二叉树的深度为最远叶子节点到根节点的距离,即根节点到最远叶子节点的距离)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest ...
分类:
其他好文 时间:
2014-11-27 17:55:50
阅读次数:
145
题目描述:
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-11-27 14:36:22
阅读次数:
187
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 longes...
分类:
其他好文 时间:
2014-11-27 07:59:55
阅读次数:
184
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,...
分类:
其他好文 时间:
2014-11-27 06:43:44
阅读次数:
162
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],t...
分类:
其他好文 时间:
2014-11-27 01:29:03
阅读次数:
187
题意:
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum prof...
分类:
其他好文 时间:
2014-11-27 00:17:48
阅读次数:
227