Hash clash, Data Structure & Algorithms

Assignment Help:

Q. What do you understand by the term by hash clash? Explain in detail any one method to resolve the hash collisions.                                                                                                   

Ans:

Hashing is not a perfect technique. The collision occurs seldom when the two different key hash into the same hash value and are also assigned to the same array element by mistake. Programmers have come up with number of techniques for dealing with this problem. An ordinary way to deal with a collision is to create a linked list of entries that have their hash value same. For example, let the key of each entry hashes to the same hash value and this process result in both being assigned to the same array element of the particular hashtable.

Because the two entries cannot be assigned the same array element, the programmer makes a linked list. The first user-explained structure is assigned to the pointer in the array element. The second isn't assigned to any of the array element and is instead linked to the first user-defined structure, therefore forming a linked list.

For example: in the below table of the size 7

42, 56 both are mapped to index 0 as 42%7=0 and 56%7=0.

25, 42, 96, 101, 102, 162, 197 can be mapped as shown below:

174_Hash clash.png


Related Discussions:- Hash clash

Whether a binary tree is a binary search tree or not, Write an algorithm to...

Write an algorithm to test whether a Binary Tree is a Binary Search Tree. The algorithm to test whether a Binary tree is as Binary Search tree is as follows: bstree(*tree) {

Insertion sort, It is a naturally occurring sorting method exemplified thro...

It is a naturally occurring sorting method exemplified through a card player arranging the cards dealt to him. He picks up the cards like they are dealt & added them into the neede

Complexity of an algorithm, An algorithm is a sequence of steps to solve a ...

An algorithm is a sequence of steps to solve a problem; there may be more than one algorithm to solve a problem. The choice of a particular algorithm depends upon following cons

Depth first traversal, A depth-first traversal of a tree visits a nodefirst...

A depth-first traversal of a tree visits a nodefirst and then recursively visits the subtrees of that node. Similarly, depth-first traversal of a graph visits a vertex and then rec

Efficient algorithms.., implementation of fast fourier transforms for non p...

implementation of fast fourier transforms for non power of 2

Enumerate about the concept of container, Enumerate about the concept of co...

Enumerate about the concept of container A Container can have a size() operation. We can also ask (somewhat redundantly) whether a Container is empty. And even though a Contain

The number of different directed trees with 3 nodes, The number of differen...

The number of different directed trees with 3 nodes are ?? The number of disimilar directed trees with three nodes are 3

Define the term ''complexity of an algorithm, Define the term 'complexity o...

Define the term 'complexity of an algorithm; Complexity of an algorithm is the calculate of analysis of algorithm. Analyzing an algorithm means predicting the resources that th

Types of triangular matrices, Triangular Matrices Tiangular Matrices is...

Triangular Matrices Tiangular Matrices is of 2 types: a)  Lower triangular b)  Upper triangular

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd