上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页
摘要: Given a list of integers, which denote a permutation.Find the previous permutation in ascending order.NoteThe list may contains duplicate integers.Exa... 阅读全文
posted @ 2014-12-29 09:55 LiBlog 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, heapify it into a min-heap array.For a heap array A, A[0] is the root of heap, and for each A[i], A[i * 2 + 1] is the left chi... 阅读全文
posted @ 2014-12-29 09:10 LiBlog 阅读(736) 评论(0) 推荐(0) 编辑
摘要: Numbers keep coming, return the median of numbers at every time a new number added.ExampleFor numbers coming list: [1, 2, 3, 4, 5], return [1, 1, 2, 2... 阅读全文
posted @ 2014-12-29 09:02 LiBlog 阅读(448) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Example For [5, 4, 1, 2, 3] 阅读全文
posted @ 2014-12-29 04:45 LiBlog 阅读(2117) 评论(0) 推荐(0) 编辑
摘要: Find K-th largest element in an array.NoteYou can swap elements in the arrayExampleIn array [9,3,2,4,8], the 3th largest element is 4ChallengeO(n) tim... 阅读全文
posted @ 2014-12-29 04:16 LiBlog 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array. Find it. Note There i 阅读全文
posted @ 2014-12-28 00:22 LiBlog 阅读(1212) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, the majority number is the number that occurs more than 1/3 of the size of the array.Find it.NoteThere is only one majorit... 阅读全文
posted @ 2014-12-27 23:17 LiBlog 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it.ExampleFor [1, 1, 1, 1, 2, ... 阅读全文
posted @ 2014-12-27 22:55 LiBlog 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l... 阅读全文
posted @ 2014-12-27 22:46 LiBlog 阅读(603) 评论(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 th... 阅读全文
posted @ 2014-12-27 22:22 LiBlog 阅读(378) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页