3 ms·
He is talking about using it as a hash function and clearly states so. To quote: > 1. Hash the key > 2. Map the hash value to a slot > Knuth [Fibonacci Hash]
by ghusbands 8y ago
He is talking about using it as a hash function and clearly states so. To quote:
> 1. Hash the key
> 2. Map the hash value to a slot
> Knuth [Fibonacci Hash] uses the term “hash function” to refer to something that does both step 1 and step 2.
- junctioniv 8y agoActually that quote is in the article for the opposite reason. He is referencing that because historically Fibonochi hashing was coupled with a hashing function and that is why it’s overlooked as a mapping function. His article is specifically advocating using the Fibonacci method only for mapping. He is writing from the context of writing a hash table library where the user is expected to provide their own hashing function.
- ghusbands 8y agoWhen someone else pointed out that you need another hash function on the front: Author: "Why [would] Fibonacci hashing not work as a hash function alone? It should, unless you have a use case that results in lots of Fibonacci numbers being inserted. You can use the identity function as the hash when you use Fibonacci hashing to assign a hash to an index."