You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came to realize that V and G can have different sizes: grow G to have a bigger set of hash values that then map to the V array
Or grow V with the same sized G to have more entries and thus more possibilities.
This is exemplified by the fact that the modulo in the evaluation function are separate for the Gs and the Vs, see below.
# Look up a value in the hash table, defined by G and V.defPerfectHashLookup( G, V, key ):
d=G[hash(0,key) %len(G)]
ifd<0: returnV[-d-1]
returnV[hash(d, key) %len(V)]
Personally, I prefer the growing of G as this is only an array of numbers, whereas V and the original keys are possibly larger data types (including int64 and strings).
No description provided.
The text was updated successfully, but these errors were encountered: