Documente Academic
Documente Profesional
Documente Cultură
STRUCTURES
MAHESH GOYANI
MAHATMA GANDHI INSTITUE OF TECHNICAL EDUCATION & RESEARCH CENTER
mgoyani@rediffmail.com
00 31300 00 31300
01 49001 01 49001
02 52202 02 52202
Key = 12704 03 Empty 03 12704
04 12704 04 65606
Hash Fun.
Key % 100 05 Empty 05
06 65606 06
… … … …
… … … …
98 … 98 …
99 99
If two number appears with the same hash value, like 12345 and 23645, than
both has to the same location ARRAY [45]. This is known as collision.
Collision is one of the problem while designing the good hash function.
Minimization of collision is also too difficult.
00
01 14001
14001 02
00104 03 50003
50003 04 00104
77003 05 77003
42504 06 42504
33099 07
08
..
..
99 33099
00
01 14001
Linear probing solves one problem but 02
generates another 03 50003
04 00104
05 77003
06 42504
07
08
..
..
99 33099
00
Record with key 03,04,05,06 and 07 would
01 14001
be inserted at array room 7, that is array room
7 is five times as likely as array room 8 to be 02
filled. 03 50003
Clustering results in to inconsistent 04 00104
efficiency of insertion and retrieval. 05 77003
06 42504
07
08
..
..
99 33099
INDEX RECORD
00 10100 10100
01
02
04
05
07
…..
99