Professional Documents
Culture Documents
University of Science and Technology Chittagong
University of Science and Technology Chittagong
Nadia Mehzabin
Mr. Sukanta Paul(SIR)
ID: 17010115
Lecturer, Dept. of CSE
Batch: 29th
FSET USTC
Presentation Topic
HASHING
Hashing
Division method:
If there are m slots available,then the key is mapped to given m
slots using following formula:
H(k)=k(mod m)
Or,H(k)=k(mod m)+1
Here,k(mod m) denotes the reminder when k is divided by m.the
second formula is used where we want the hash address to range
from 1 to m,rather than from 0 to m-1.
Hash function methods( Cont’d )
Midsquare method:
In this method the formula is H(k)=l
Where the key k is squared.
And l is obtained by deleting digits from both ends of the k2
Folding method:
In this method, the given key k is partitioned into subparts
k1,k2,k3,k4,kn
Each of which has the same length as the required
address.now add all these parts together and ignore the
carry:
H(k)=k1+k2+k3+……………+kn is the formula.
Problem
Here,m=97
K1=9614,k2=5882,k3=6713,k4=4409,k5=1825
Division method