There are things that have been committed.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package bloom_filters;
|
package bloom_filters;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
import tester.Tester;
|
import tester.Tester;
|
||||||
|
|
||||||
class BitVec {
|
class BitVec {
|
||||||
@@ -23,7 +24,16 @@ class BitVec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Hash {
|
class Hash {
|
||||||
static
|
// Create k hash functions.
|
||||||
|
static int[] hash(Object o, int k, int m) {
|
||||||
|
Random rand = new Random(o.hashCode());
|
||||||
|
|
||||||
|
int[] ret = new int[k];
|
||||||
|
|
||||||
|
for (int i = 0; i < k; i++) ret[i] = rand.nextInt(m);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Examples {
|
class Examples {
|
||||||
|
Reference in New Issue
Block a user