问题描述:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 ele...
分类:
其他好文 时间:
2015-01-13 23:17:46
阅读次数:
330
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from ...
分类:
其他好文 时间:
2015-01-13 17:51:17
阅读次数:
180
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain dupli...
分类:
其他好文 时间:
2015-01-13 17:45:51
阅读次数:
139
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 ...
分类:
其他好文 时间:
2015-01-13 15:45:26
阅读次数:
126
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For exa...
分类:
其他好文 时间:
2015-01-13 10:35:09
阅读次数:
181
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
编程语言 时间:
2015-01-13 06:42:51
阅读次数:
201
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements.
Y...
分类:
编程语言 时间:
2015-01-12 22:34:27
阅读次数:
274
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from ...
分类:
编程语言 时间:
2015-01-12 21:01:06
阅读次数:
280
问题你想使用类似于CSS或jQuery的语法来查找和操作元素。方法可以使用Element.select(String selector) 和 Elements.select(String selector) 方法实现:File input = new File("/tmp/input.html");...
分类:
Web程序 时间:
2015-01-12 16:07:36
阅读次数:
221
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
...
分类:
其他好文 时间:
2015-01-12 14:45:45
阅读次数:
166