What is hashing why we need it?
Consider it as a process of converting any input to an integer value.A string can have a hash value, a java Object can have hash value.
We need it to place these input to particular cell or bucket.So that whenever we need to find this object, we will find it in particular cell or bucket only.This will decrease the search time for an input object.
Click here to understand this part via youtube tutorial
Good Hashing Techniques
Since we need to convert the input value to some integer value, method or step to convert it should be simple and faster, as a user should not spend much time and effort on the secondary task.The second thing you should keep in mind is that your function should create different int value for different input for maximum cases.Otherwise, you will end up keeping elements in single or only a few buckets which will make search more problematic.
Two thing you have to learn is
- Event Distribution and Easy Computation
- Collision Detection and Resolution
- Collision resolution
This is a minimum of hashing everyone should know.Will try to cover the hashing in depth in my upcoming blogs.