Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created August 5, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/806d61d8cd2522a4a797838694069293 to your computer and use it in GitHub Desktop.
Save cipepser/806d61d8cd2522a4a797838694069293 to your computer and use it in GitHub Desktop.
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