Commit 089824e0 authored by Tonia Yeung's avatar Tonia Yeung
Browse files

Added main method for BloomFilterSolution

parent 5b7c775e
Pipeline #2184 failed with stages
......@@ -46,4 +46,28 @@ public class BloomFilterSolution {
return bitVector[modded];
}
public static void main(String[] args){
BloomFilterSolution bf = new BloomFilterSolution();
int hash = bf.hash("Tonia");
int hash2 = bf.hash("Tonias");
System.out.println("The first hash is: " + hash);
System.out.println("The second hash is: " + hash2);
bf.add("Tonia");
System.out.println("\n\nAfter adding Tonia:");
for(int i = 0; i < bf.bitVector.length; i++){
System.out.println("Can see that the " + i + "th index is " + bf.bitVector[i]);
}
boolean isPresent = bf.check("Tonia");
System.out.println("\nCan see that Tonia is possibly present: " + isPresent);
boolean isNotPresent = bf.check("Tonias");
System.out.println("\nCan see that Tonias is not present: " + isNotPresent);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment