DDSA Solutions

Hash Function

5 problems

Custom hash functions reduce collisions in hash maps. Polynomial rolling hash H(s) = s[0]·pⁿ⁻¹ + ... + s[n-1] is common for strings. Use double hashing (two independent hashes) to reduce collision probability to near zero.