Advanced Data Structures: Double Hashing

preview_player
Показать описание
CORRECTIONS/NOTES:
* 6:46: h_1(k) should be h_1(x)
Рекомендации по теме
Комментарии
Автор

What does this have to do with double hashing?

reddistone
Автор

If we use digit floding method as hash function, then hash key for 70 is 7(7+0).where we have to insert key 70 as the table size Is 5

hhh
Автор

why talk about linear probing in a video about double hashing

channelname
Автор

what if after double hash there is collision too??

pawmeowzing
Автор

Wouldn't you want your second hash function to always output a number coprime to the length of the table for this to work? Otherwise you end up wasting space as when doing the "probing" step you could easily miss empty slots.

beegyoshi
Автор

You gave hash_function1(x) = x%5. Therefore, your hash_function2(x)  = 1 + (hash_function1(x)/m)%(m-1) for 70 would be hash_function2(x) = 1 + ((x%5)/m)%(m-1) = 1 + ((70%5)/5)%(5-1) = 1 + (0/5)%4 = 1. Therefore, your hash_function2 is giving a different value than the one you computed (1 instead of 3). Maybe you meant hash_function2(x) = 1 + (x/m)%(m-1)? This would give you 1 + (70/5)%(5-1) = 1 + 14%4 = 3.

jacobtrombley
Автор

you spent half the video talking about linear probing in a video titled double probing smh

bwbs