Hashing
Hashing
Hashing
PRESENTED BY
SHAKUNTLA RAVANI
ASST. PROFF.
PSE
SYMBOL TABLE
read
do
While
RECORDS
KEY
F( ) ADDRESS 0
1
2
4
5
6
CONT..
0 ……….
1 ……….
.
.
.
……….
B-1
CONT..
• The basic idea is that records are partitioned in
‘B’ classes , numbered o,1,2,….,B-1.
• Hashing function f(x) maps records with key n to
integer values between 0 to B-1. If record is
mapped to location 1 than we can say that record
is mapped to bucket 1 or class 1.
• Each bucket of bucket table is the head of linked
list of records mapped to bucket.
CLOSED HASHING
2 32 72 NULL
3 53 NULL
4 NULL
5 105 NULL
6 66 56 NULL
7 77 NULL
8
NULL
9
NULL
SEPARATE CHAINING