码迷,mamicode.com
首页 >  
搜索关键字:lintcode    ( 1584个结果
LintCode-Kth Largest Element
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...
分类:其他好文   时间:2014-12-29 06:29:53    阅读次数:116
LintCode-Majority Number III
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.NoteThere is ...
分类:其他好文   时间:2014-12-28 01:38:59    阅读次数:367
LintCode-Majority Number II
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...
分类:其他好文   时间:2014-12-28 00:28:38    阅读次数:218
LintCode-Majority Number
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, ...
分类:其他好文   时间:2014-12-28 00:19:54    阅读次数:179
LintCode-Subarray Sum
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...
分类:其他好文   时间:2014-12-27 23:00:42    阅读次数:421
LintCode-Partition Array
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....
分类:其他好文   时间:2014-12-27 22:55:19    阅读次数:207
LintCode-O(1) Check Power of 2
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) timeAnalysis:Use bit manip...
分类:其他好文   时间:2014-12-27 06:44:21    阅读次数:179
LintCode-Rehashing
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...
分类:其他好文   时间:2014-12-27 06:43:00    阅读次数:359
LintCode-Subarray Sum Closest
Given an integer array, find a subarray with sum closest to zero. Return the indexes of the first number and last number.ExampleGiven [-3, 1, 1, -3, 5...
分类:其他好文   时间:2014-12-27 06:42:21    阅读次数:661
LintCode-Maximum Subarray Difference
Given an array with integers.Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest.Return the largest difference.NoteThe ...
分类:其他好文   时间:2014-12-27 06:41:35    阅读次数:140
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!