An efficient collision resolution strategy based
on 2D array is proposed in this paper. It is
interesting to see the role of multidimensional
array and other similar data structures that
outperforms the presented technique.
MATRIX HASHING WITH TWO LEVEL OF COLLISION RESOLUTION
1. MATRIX HASHING WITH TWO LEVEL COLLISION
RESOLUTION
Authors
Anand Agrawal, Sriram Bhyravarapu and N.V.K.Chaitanya
Presented by
N.V.K.Chaitanya
2. Agenda
• Hashing and it's existence
• Existing hashing techniques and their disadvantages
• Proposed work
• Advantages and disadvantages
• Conclusion
3. Hashing and it's existence
• A hash function is a function which when given a Value, generates
an address in the table. The example of a hash function is a book
call number. Each book in the library has a unique call number.
• A hash table uses a hash function to compute an index into an
array in which an element will be inserted or searched.
• By using a good hash function, hashing can work well.
4. Existing hashing techniques and their
disadvantages
• Using a single Dimensional array will only provide two directions to
move in a array which is forward or backwards.
5. Proposed Work
• Using a two Dimensional Array for the hashing technique.
• Using two different prime numbers to hash the items,
improving collision free range.
• Using two level collision handling technique.
6. Two dimensional Array
• We use a two dimensional matrix with dimensions
[q+3][p+2]. Given p , q are the prime numbers used in
hashing.
• rows([0][*], [q][*]), columns[*][0],[*][p] are there to act as
neighbours to the blocks that are on the edge of matrix.
• Row([q+2][*]) is used as Collision removal block, which will
be further discussed in the topic Level 2 collision handling.
7. Advantages of using a two dimensional Array
• Having eight neighbours will give more blocks to handle
collision, when one occurs.
• Having eight neighbours will give more blocks to handle
collision, when one occurred.
8. Using two prime numbers for hashing
• By using two prime numbers p , q for hashing can avoid
collision for numbers in range 0 to p*q . So if we know the
range of the numbers being inserted we can avoid
collision.
• By using q for hashing we will calculate 1st dimensional
index and by using p we can compute 2nd dimension
index. That is [V%q][V%p].
9. Two level collision handling technique.
• As we cant predict the numbers that are going to be
inserted in the matrix, we have a Two levels of collision
handling.
10. Level one collision handling technique
• When ever a number is given to be inserted we hash them
using the selected prime numbers. Let the result to be
stored in variables i , j.
• If array[i+1][j+1] is empty the element is inserted, else the
element will be inserted in any one of the eight neighbours
which was empty.
11. Level two collision handling technique
• If all the neighbours of the selected block are filled the
level two collision handling is done.
• The element that to be inserted will inserted in the collision
removal block that is [q+2] row.
• When we are inserting, we insert sort the element such
that all the elements in the row are sorted.
12. Searching
• When an element is to be searched, we calculate values
of i , j. Then search the block [i+1][j+1], if not found all the
eight neighbours will be searched.
• If any of the block is empty in the sequence then the
element is not present, If al are filled we compute a binary
search on the collision removal block.
• The result of the search determines the result of search for
the element
13. Advantages and Disadvantages
• Advantages
• Can completely remove collision in the range p*q.
• Search Complexity: O(log(n))
• Disadvantages
• High memory requirement
• There is a chance of overflow in collision removal block even when
there are few empty blocks in matrix.
14. Conclusion
• An efficient collision resolution strategy based on 2D array
is proposed in this paper. It is interesting to see the role of
multidimensional array and other similar data structures
that outperforms the presented techniques.