File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
bloomfilter/BloomFilterImpl/src/main/java/ds/bloomfilterimpl Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ public class Main {
4
4
5
5
public static void main (String [] args ) {
6
6
7
- // 0.3 = 30% false positive probability wanted, 10 elements expected
7
+ // use one of the available constructors
8
+ // 0.3 = 30% false positives probability expected, 10 elements expected
8
9
BloomFilter bf = new BloomFilter (0.3 , 10 );
9
10
10
11
bf .add ("Octavia" );
@@ -26,5 +27,8 @@ public static void main(String[] args) {
26
27
System .out .println ("Number of hash functions: "
27
28
+ bf .getNumberOfHashFunctions ());
28
29
30
+ System .out .println ("Marua is there? " + bf .contains ("Marua" )); // expected true
31
+ System .out .println ("Alexandra is there? " + bf .contains ("Alexandra" )); // expected false
32
+
29
33
}
30
34
}
You can’t perform that action at this time.
0 commit comments