摘要:
Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.This matrix has the following properties: * ... 阅读全文
posted @ 2015-04-02 12:26
neverlandly
阅读(2222)
评论(0)
推荐(0)
摘要:
The size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size >= capacity / 10), we should do... 阅读全文
posted @ 2015-04-02 11:13
neverlandly
阅读(850)
评论(0)
推荐(0)
摘要:
Given a rotated sorted array, recover it to sorted array in-place.Example[4, 5, 1, 2, 3] -> [1, 2, 3, 4, 5]ChallengeIn-place, O(1) extra space and O(n... 阅读全文
posted @ 2015-04-02 10:33
neverlandly
阅读(1366)
评论(0)
推荐(0)
摘要:
Given an integers array A.Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B without divide operation.ExampleFor A=[1, 2, 3], B is... 阅读全文
posted @ 2015-04-02 09:59
neverlandly
阅读(1932)
评论(0)
推荐(0)
摘要:
Given a list of integers, which denote a permutation.Find the previous permutation in ascending order.NoteThe list may contains duplicate integers.Exa... 阅读全文
posted @ 2015-04-02 07:01
neverlandly
阅读(1212)
评论(0)
推荐(0)
摘要:
Given an array "nums" of integers and an int "k", Partition the array (i.e move the elements in "nums") such that, * All elements = k are moved to ... 阅读全文
posted @ 2015-04-02 06:21
neverlandly
阅读(1702)
评论(0)
推荐(0)
摘要:
Using O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return trueFor n=5, return falseChallengeO(1) timeTags Expand 这道题考察bit m... 阅读全文
posted @ 2015-04-02 05:24
neverlandly
阅读(575)
评论(0)
推荐(0)
摘要:
1 Given an integer array, adjust each integers so that the difference of every adjcent integers are not greater than a given number target.2 3 If the ... 阅读全文
posted @ 2015-04-02 04:56
neverlandly
阅读(1961)
评论(0)
推荐(0)
摘要:
Find the nth to last element of a singly linked list. The minimum number of nodes in list is n.ExampleGiven a List 3->2->1->5->null and n = 2, return... 阅读全文
posted @ 2015-04-02 03:40
neverlandly
阅读(553)
评论(0)
推荐(1)
浙公网安备 33010602011771号