3 ms·
> You'll notice its hash function only needs to consider a single character in in a string. That's what makes it perfect, Is that a joke? https://en.m.wikiped
by lupire 2y ago
> You'll notice its hash function only needs to consider a single character in in a string. That's what makes it perfect,
Is that a joke?
https://en.m.wikipedia.org/wiki/Perfect_hash_function https://en.m.wikipedia.org/wiki/Perfect_hash_function
- jaen 2y agoNo. Taking the value of a single character is a correct perfect hash function, assuming there exists a position for the input string set where all characters differ.
- anitil 2y agoIt just so happens that a single character was all that's needed in that case. In the general case it wouldn't be