Skip to content

Commit 58675f0

Browse files
Update Main.java
1 parent c31c88e commit 58675f0

File tree

1 file changed

+5
-1
lines changed
  • bloomfilter/BloomFilterImpl/src/main/java/ds/bloomfilterimpl

1 file changed

+5
-1
lines changed

bloomfilter/BloomFilterImpl/src/main/java/ds/bloomfilterimpl/Main.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ public class Main {
44

55
public static void main(String[] args) {
66

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
89
BloomFilter bf = new BloomFilter(0.3, 10);
910

1011
bf.add("Octavia");
@@ -26,5 +27,8 @@ public static void main(String[] args) {
2627
System.out.println("Number of hash functions: "
2728
+ bf.getNumberOfHashFunctions());
2829

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+
2933
}
3034
}

0 commit comments

Comments
 (0)