By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find th...
分类:
其他好文 时间:
2014-06-07 13:45:25
阅读次数:
189
Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight line./** * Definition for a
point. * struct Point { * ...
分类:
其他好文 时间:
2014-06-07 00:31:01
阅读次数:
233
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 le...
分类:
其他好文 时间:
2014-06-05 14:10:38
阅读次数:
304
Problem Description:
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 at most two transa...
分类:
其他好文 时间:
2014-06-05 09:33:52
阅读次数:
342
Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight line.public class Solution { /**
* This program is used t....
分类:
其他好文 时间:
2014-06-03 17:05:21
阅读次数:
434
链接: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2116
Description
Wind and his GF(game friend) are playing a small game. They use the computer to randomly generated a nu...
分类:
其他好文 时间:
2014-06-03 02:17:13
阅读次数:
252
1、Maximum Depth of Binary Tree
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.
clas...
分类:
其他好文 时间:
2014-06-02 23:13:22
阅读次数:
290
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-06-02 09:22:03
阅读次数:
328
maximum函数取一组可排序的 List(属于 Ord Typeclass)
做参数,并回传其中的最大值。想想,在命令式风格中这一函数该怎么实现。很可能你会设一个变量来存储当前的最大值,然后用循环遍历该
List,若存在比这个值更大的元素,则修改变量为这一元素的值。到最后,变量的值就是运算结果。唔...
分类:
其他好文 时间:
2014-06-02 00:11:06
阅读次数:
412