题目
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,?5,4],
the contiguous subarray [4,...
分类:
其他好文 时间:
2014-06-19 12:08:20
阅读次数:
270
Infinite Iterators:
Iterator
Arguments
Results
Example
count()
start, [step]
start, start+step, start+2*step, ...
count(10) --> 10 11 12 13 14 ...
cycle()
p
p0, p1, ......
分类:
编程语言 时间:
2014-06-19 11:14:58
阅读次数:
359
package com.example.android_provider3;
import android.app.Activity;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
public class OnScrollListenerDemo extends A...
分类:
其他好文 时间:
2014-06-16 12:02:06
阅读次数:
162
Given a binary tree and a sum, find all root-to-leaf paths where each path's
sum equals the given sum.
For example:
Given the below binary tree and
sum = 22,
5
...
分类:
其他好文 时间:
2014-06-15 19:55:39
阅读次数:
191
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recursive solut...
分类:
其他好文 时间:
2014-06-15 19:06:52
阅读次数:
166
Given an unsorted integer array, find the first
missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1]
return 2.Your algorithm s...
分类:
其他好文 时间:
2014-06-13 20:25:38
阅读次数:
241
Swap Nodes in Pairs:Given a linked list, swap every
two adjacent nodes and return its head.For example,Given1->2->3->4, you
should return the list as2...
分类:
其他好文 时间:
2014-06-13 17:04:27
阅读次数:
180
Rotate ListGiven a list, rotate the list to the
right bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3-...
分类:
其他好文 时间:
2014-06-13 16:39:53
阅读次数:
307
Given a collection of intervals, merge all
overlapping intervals.For
example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].public class
S...
分类:
其他好文 时间:
2014-06-13 15:12:35
阅读次数:
180
Given a binary tree, flatten it to a linked
list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-06-13 15:11:35
阅读次数:
273