Given an integer array with no duplicates. A max tree building on this array is defined as follow:The root is the maximum number in the arrayThe left ...
分类:
其他好文 时间:
2014-12-27 06:37:51
阅读次数:
132
Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.NoteYou are not necessary to keep ...
分类:
其他好文 时间:
2014-12-27 01:26:58
阅读次数:
421
Given an directed graph, a topological order of the graph nodes is defined as follow:For each directed edge A-->B in graph, A must before B in the ord...
分类:
其他好文 时间:
2014-12-27 00:15:16
阅读次数:
330
Given an array of integers and a number k, find k non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguou...
分类:
其他好文 时间:
2014-12-25 09:55:31
阅读次数:
235
Given an array of integers, find two non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguous.Return the ...
分类:
其他好文 时间:
2014-12-25 08:44:08
阅读次数:
232
Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7.The eligible numbers are like 3, 5, 7, 9, 15 ...ExampleIf ...
分类:
其他好文 时间:
2014-12-25 08:43:45
阅读次数:
240
Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack?NoteYou can not divide any item into sm...
分类:
其他好文 时间:
2014-12-25 06:37:21
阅读次数:
175
Given a matrix of lower alphabetsand a dictionary.Find all words in the dictionary that can be found in the matrix. A word can start from any position...
分类:
其他好文 时间:
2014-12-25 06:35:39
阅读次数:
169
Calculate the an% b where a, b and n are all 32bit integers.ExampleFor 231 % 3 = 2For 1001000 % 1000 = 0ChallengeO(logn)Solution: 1 class Solution { 2...
分类:
其他好文 时间:
2014-12-25 06:35:20
阅读次数:
238
In data structure Hash, hash function is used to convert a string(or any other type) into an integer smaller than hash size and bigger or equal to zer...
分类:
其他好文 时间:
2014-12-25 06:33:10
阅读次数:
376