1 Dec 2019

  • December 01, 2019
  • Amitraj
What is Hashing?

-> Hashing is a well known technique to search any particular element among several elements.

-> it minimizes the number of comparisions while performing the search.


Advantages

1. Hashing is extreamly efficient.

2. The time taken by it to perform the search does not depend upon the total number of elements.


Hashing Mechanism

1. An Array data structure called as Hash table is used to store the data items.

2. Based on the hash key value, data items are inserted into hash table.



Hash Key Value

1. Hash key value is a special value that serves as an index for a data item.

2. It indicates where the data item should be stored in the hash table.

3. Hash key value is generated using a Hash function.




Hash Function

-> It is a function that maps any big number or string to a small integer value.

->Hash function takes the data item as an input and returns a small integer value as an output.

->The small integer value is called as a hash value.

-> Hash value of the data item is then used as an index for storing it into the hash table.


Translate

Popular Posts