Last active
January 31, 2017 05:40
-
-
Save cipepser/24ff41df156b37c624f28d0cb15406b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
var bf BloomFilter | |
// 要素の追加 | |
Add(&bf, "1") | |
Add(&bf, "2") | |
Add(&bf, "3") | |
Add(&bf, "4") | |
Add(&bf, "5") | |
// 要素が含まれているか検証 | |
fmt.Println(Exists(&bf, "1")) // true | |
fmt.Println(Exists(&bf, "2")) // true | |
fmt.Println(Exists(&bf, "3")) // true | |
fmt.Println(Exists(&bf, "4")) // true | |
fmt.Println(Exists(&bf, "5")) // true | |
fmt.Println(Exists(&bf, "10")) // false | |
fmt.Println(Exists(&bf, "999")) // true(偽陽性) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment