I want to implement a hashing technique in C
where all the permutation of a string have same hash keys.
e.g. abc
& cab
both should have same keys.
I have thought of adding the ascii
values & then checking frequency of characters
[important otherwise both abc
& aad
would have same keys which we do not want].
But, it doesn't seem to be much efficient.
Is there any better hashing function which resolves collisions well & also doesn't result into sparse hash table?
Which hashing technique is used internally by Java [for strings
] which not only minimizes the collisions but also the operations[insertion ,deletion, search
] are fast enough?