how map in golang solve hash collision?

2,258 views
Skip to first unread message

xie cui

unread,
Sep 4, 2021, 3:58:12 AM9/4/21
to golang-nuts
I am discussing with my friends about how map solve hash collision. 
In my opinion, map uses separate chaining to solve hash collision.
but some of my friends think it is linear probing that solve the hash collision.

Axel Wagner

unread,
Sep 4, 2021, 4:12:41 AM9/4/21
to xie cui, golang-nuts
I recommend https://www.youtube.com/watch?v=Tl7mi9QmLns to learn about how Go maps work. It's quite in-depth.
To your specific question: Go maps use separate chaining. Every bucket is a linked list, where every list element stores 8 map entries.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/aef554b8-5067-401e-b9d4-a09adf9691c2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages