Sunteți pe pagina 1din 10

DATA

STRUCTURES

MAHESH GOYANI
MAHATMA GANDHI INSTITUE OF TECHNICAL EDUCATION & RESEARCH CENTER
mgoyani@rediffmail.com

|  


HASHING

|  


TERMINOLOGY

4
O(1) ¢¢ !¢"
4  # $%¢!
¢¢&$% "
4 ¢¢# ' ( &$% 
!#%)* +,"

|  


COMPARISION

Index Record Index Record

h1h h1h

1  1 1  1

2 522 2 2 522 2
- * ./+ h Empty h 127 

 127   656 6

0'"
- 1 // 5 Empty 5

6 656 6 6

ƕ ƕ ƕ ƕ

ƕ ƕ ƕ ƕ

 ƕ  ƕ

 

Hashed Insertion Linear Insertion

|  

+
COLLISION

4 !$'&$'#% +,2+,#
&¢334+,5"6%$¢"
4 !&$!'¢"
4 7!¢!!¢'"

|  

,
LINEAR PROBING

¢¢¢¢
&¢"
Order of Index Actual Scene
Insertion

1 1 1
1 1 2
1  h 5 h
5 h  1 
77 h 5 77 h
25  6 25 
hh  7

..

..

 hh 

|  

2
DELETION

Index Actual Scene

1 1 1
4 i&&&' 2
 h 5 h
 1 
5 77 h
6 25 
7

..

..

 hh 

|  

.
CLUSTERING

Index Actual Scene

4 3¢$% /#/+#/,#/2/.$'
1 1 1
& .# 
.!%  8& 2
!" h 5 h
4 ''¢  1 
!!¢¢ !" 5 77 h
6 25 
7

..

..

 hh 

|  

8
REHASHING

4 !!'¢'¢¢#''
'!'¢"
4 i&:|'; 1 7
4 0$&:
|
';¢1 7
4 ¢  7'& #
¢¢
4 <'¢=&:
|
>';1  7
4 ='&:
|
>';|1  7

|  

9
BUCKET & CHAINING

INDEX RECORD

' 1 1 ' 1 1

h ' hhh h ' 111 h ' 222 h

6 ' hhh 6 ' 111 6 ' 222 6

ƕ..



|  

/