I have some integer value like:
0, 2, 3, 1021, 2001, 2101, 3054 ...
Now, I want to put those values in a hash table. The integers are distributed like: every 1000 interval [means, 0-1000, 1000-2000 ...] has maximum 2-3 values.
Now, in my hash table I'm simply setting the bucket number with load factor 0.5. And hash code is simply: Integer % bucket number. However, it gives many collision.
Is there any better way to handle this type of particular distribution?
I have many files with such integers. So, setting fixed bucket number is impossible.