Вы находитесь на странице: 1из 1

HASHING COLLISION: TWO TECHNIQUES TO RESOLVE THIS.

1)SEPARATE CHAINING 2)OPEN ADDRESSING SUB CATEGORIES INCLUDE i)LINEAR PROBING ii)QUADRATIC PROBING iii)DOUBLE HASHING WHAT IS PROBING? ITS NOTHING BUT TO EXAMINE OR TO SEARCH. IN LINEAR PROBING THE KEY VALUE THAT IS COLLIDE WITH ANOTHER ONE WILL BE PLACED IN THE NEXT FREE CELL(WE WILL LINEARLY SEARCH FOR THIS FREE CELL). ex size of array=10; 80 is placed in 0th index(80%10->remainder 0). 70 is collide with 80.now we will search the lisr for the next free cell. the free cell would be 1 index.we placed in it. IN QUADRATIC PROBING WE WILL APPLY A FORMULA INDEX=KEY%SIZE+i*i;(where i=1-n); ex size of array=10; 80 is placed in 0th index(80%10->remainder 0). 70 is collide with 80.now we will apply aboce formula,is as follows index=70%10+1*1=1; we check whether index 1 is empty or not.if not empty we will again apply this index=70%10+2*2=4; if empty we will place. DOUBLE HASHING this also a collision resolving technique. this uses a formula to place the collision elements Example: size=11,h(x)=x mod 11,h2(x)=x mod number of elements +1 array=14,17,25,37,34,16,26. operation index value 14 mod 11=3 17 mod 11=6 25 mod 11=3-collision here we will apply second formula called h2(x) index=25 mod 7(number of elements in an array)+1=5.this 5 is added to the previo us value i.e 3 resulting 8.

Вам также может понравиться