hashtable - How does google's sparse hash table handle collisions? -


how google's sparse hash table handle collisions? i.e. when 2 elements map same bucket, how decide put new (colliding) element? i'm reading what main implementation idea behind sparse hash table? answer doesn't cover collision idea.

your question answered in documentation here, specifically:

2c) if t.sparsetable[i % 32] assigned, value other foo, @ t.sparsetable[(i+1) % 32]. if fails, try t.sparsetable[(i+3) % 32], t.sparsetable[(i+6) % 32]. in general, keep trying next triangular number.

you can read triangular numbers here.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -