What is hashing How does it affect data access timeSolutionH
What is hashing? How does it affect data access time?
Solution
Hashing is a technique for storing and retrieving a set of values.
There is a involvement of hash function which given the actual value gives the hash value which is used for storing the value inside a structure.
Now, to store a set of values for each value we will calculate a hash value and will store the actual value at that place.
There might be possiblilty of collision which can be taken care by the techniques such as linear probing,quadratic probing and chaining.
Now to retrieve a value we will calculate the hash value of the given value and directly retrieve the value store at that hash value.
With hashing, search complexity comes down because rather than linearly scanning the structure looking for a value we will just calculate the hash value of a required value and check whether the value is present at hash value or not.
