Concept of Hashing- Here the basic concept of Hashing has been explained. The source code for the same has been provided.
Here the condition for collision has been mentioned and has been taken care off by the method of linear probing.
Hashing is the concept of storing data in a more efficient manner. Using a hash table we maintain the records say storing the data of 1000 employees by their employee number. Each employee is assigned a unique key which is calculated using a hash function which is dependent on the size of the array(E.g. %10, %15, %20 etc.) with which the information of the employee can be obtained. However in a large database it may be possible by chance that two or more users share the same key values and there arises the concept of collision. There are mulitple methods to deal with such a situation. Here I have mentioned about Linear Probing.
Linear Probing is a method wherein if a particular address is already filled up by a particular entry then the next available location is searched in the array using the concept of circular queue for effective utilization of space, as arrays possess a static allocation of memory. With the help of key value associated with each data entry, searching in a big array is easier with the help of hashing.