Created
August 5, 2017 09:27
-
-
Save cipepser/806d61d8cd2522a4a797838694069293 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
ackage main | |
import ( | |
"fmt" | |
"./hopscotch" | |
) | |
func main() { | |
h := hopscotch.NewHopscotch() | |
for i := 0; i < 10; i++ { | |
err := h.Insert(int64(i + 1)) | |
for err != nil { | |
h = h.Reconstruct() | |
err = h.Insert(int64(i + 1)) | |
} | |
fmt.Println("-----------------------------") | |
fmt.Println("No. \t| bucket") | |
fmt.Println("-----------------------------") | |
for j, b := range h { | |
fmt.Println(j, "\t| ", b) | |
} | |
fmt.Println("") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment