Open In App

Folding Method in Hashing

Folding Method in Hashing: It breaks up a key value into precise segments that are added to form a hash value, and look at another technique is to apply a multiplicative hash function to each segment individually before adding. Some folding methods go one step further and reverse every other piece before the addition. This folding method is independent of distribution.

Algorithm:



Explanation:

Example 1: The task is to fold the key 123456789 into a Hash Table of ten spaces (0 through 9).



Example 2: The task is to fold the key 452378912 into a Hash Table of ten spaces (0 through 9).

Article Tags :