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 consecutive elements sequence is [1, 2, 3...
分类:
其他好文 时间:
2015-01-07 10:58:06
阅读次数:
191
Subsets IIGiven a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descend...
分类:
其他好文 时间:
2015-01-06 21:19:17
阅读次数:
135
SubsetsGiven 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...
分类:
其他好文 时间:
2015-01-06 19:48:38
阅读次数:
143
题目:
Given an array S of n integers, are there elements a, b, c in S such that a + b + c =
0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a tripl...
分类:
编程语言 时间:
2015-01-06 10:06:42
阅读次数:
130
题目:(Tree ,DFS)Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using ...
分类:
其他好文 时间:
2015-01-06 02:03:43
阅读次数:
172
【题目】
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 consecutive elements sequence i...
分类:
其他好文 时间:
2015-01-04 23:07:30
阅读次数:
233
UI design can be divided into three essential elements : functionality, aesthetics, and performance.The following are some design phase tasks that can...
分类:
其他好文 时间:
2015-01-04 14:56:50
阅读次数:
141
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 ...
分类:
其他好文 时间:
2015-01-04 06:25:08
阅读次数:
192
You are given a binary array with N elements: d[0], d[1], ... d[N - 1]. You can perform AT MOST one move on the array: choose any two integers [L, R],...
分类:
其他好文 时间:
2015-01-03 07:05:32
阅读次数:
298
Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. For exampl...
分类:
其他好文 时间:
2015-01-03 07:03:25
阅读次数:
264