First Missing Positive:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] retu...
分类:
其他好文 时间:
2014-07-01 13:13:59
阅读次数:
218
【题目】
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
se...
分类:
其他好文 时间:
2014-06-29 22:45:26
阅读次数:
358
Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and ...
分类:
其他好文 时间:
2014-06-28 08:13:17
阅读次数:
249
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sho...
分类:
其他好文 时间:
2014-06-27 22:24:34
阅读次数:
346
Given an unsorted integer array, find the first missing positive integer.
分类:
其他好文 时间:
2014-06-27 12:39:02
阅读次数:
185
题目
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and u...
分类:
其他好文 时间:
2014-06-27 08:30:30
阅读次数:
202
题目
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key...
分类:
其他好文 时间:
2014-06-24 22:45:43
阅读次数:
202
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key if ...
分类:
其他好文 时间:
2014-06-24 17:25:41
阅读次数:
197
Problem Description
You are given N positive integers, denoted as x0, x1 ... xN-1. Then give you some intervals [l, r]. For each interval, you need to find a number x to make
as small as possible!
...
分类:
其他好文 时间:
2014-06-18 00:58:54
阅读次数:
276
Bloom filter的实现以及常用的hash函数
bloom filter利用时间换空间的思想,利用多个哈希函数,将一个元素的存在状态映射到多个bit中,特别是在网络环境中,BF具有广泛的用途,关键问题就是要减少false positive rate(可以设置参数来调节),扩展有 counting BF。这里选用的hash函数是表现较好的 BKDRHash , SDBMHash, D...
分类:
其他好文 时间:
2014-06-13 20:42:05
阅读次数:
412