Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given[100, 4,
200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-05-10 20:06:26
阅读次数:
404
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...
分类:
其他好文 时间:
2014-05-06 00:51:29
阅读次数:
353
Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given [100, 4,
200, 1, 3, 2],The longest...
分类:
其他好文 时间:
2014-05-05 23:01:41
阅读次数:
374
Link:http://oj.leetcode.com/problems/reverse-nodes-in-k-group/Given a linked
list, reverse the nodes of a linked listkat a time and return its modifie...
分类:
其他好文 时间:
2014-05-05 22:46:42
阅读次数:
456
Link:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list,
swap every two adjacent nodes and return its head.For example,Given1->2-...
分类:
其他好文 时间:
2014-05-05 22:45:37
阅读次数:
331
Artificial Intelligence?
Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and underst...
分类:
其他好文 时间:
2014-05-02 23:39:35
阅读次数:
485
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3749
Chameleon
Time Limit: 6 Seconds Memory Limit: 65536 KB
Given n groups of integers(all the integers are distin...
分类:
其他好文 时间:
2014-05-02 19:06:34
阅读次数:
447
这道题,采用动态规划算法。from top to
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path
sum from top to bottom. 3 * Each ...
分类:
其他好文 时间:
2014-05-02 12:19:23
阅读次数:
382
Where's Waldorf?
Given a m by n grid
of letters, ( ),
and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line o...
分类:
其他好文 时间:
2014-05-02 10:59:15
阅读次数:
514
Write an efficient algorithm that searches for
a value in anmxnmatrix. This matrix has the following properties:Integers in
each row are sorted from l...
分类:
其他好文 时间:
2014-05-02 10:41:53
阅读次数:
267