DSA Hashing Notes
DSA Hashing Notes
In a hash table, the content stored is usually of the form (key, data).
Therefore, when you are given a specific key k, you can find the
corresponding key-based data in the table. Suppose the current slot you
are checking contains (k’, data). If k=k’, then you already find the data
you want, otherwise if k!=k’, then you go on to check the next possible
slot according to the probing rules. 2.
A number n is prime if for any integer m satisfying 1<m< n , the
inequality n%m!=0 always hold.
LOAD FACTOR
N = number of elements
M = number of buckets in hash table (size of hash table)
Load factor = n/m (avg entries in one bucket)
Generally when load factor > 0.75 , we do rehashing
REHASHING : Increasing size of hash table and redistributing elements
in it