Hash clash, Data Structure & Algorithms

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

Posted Date: 7/11/2012 1:34:23 AM | Location : United States







Related Discussions:- Hash clash, Assignment Help, Ask Question on Hash clash, Get Answer, Expert's Help, Hash clash Discussions

Write discussion on Hash clash
Your posts are moderated
Related Questions
Algorithm for deletion of any element from the circular queue: Step-1: If queue is empty then say "queue is empty" & quit; else continue Step-2: Delete the "front" element

In this project you will write a program to produce a discrete time simulation of a queue as shown in Fig. 1. Time is slotted on the input and the output. Each input packet follows

Q. Make the 11 item hash table resulting from hashing the given keys: 12, 44, 13, 88, 23, 94, 11, 39, 20, 16 and 5 by making use of the hash function h(i) = (2i+5) mod 11.

In the last section, we discussed regarding shortest path algorithm that starts with a single source and determines shortest path to all vertices in the graph. In this section, we

Each of the comparison in the binary search decrease the number of possible candidates where the key value can be searched by a factor of 2 as the array is divided into two halves

Give the example of bubble sort algorithm For example List: - 7 4 5 3 1. 7 and 4 are compared 2. Since 4 3. The content of 7 is now stored in the variable which was h

Row Major Representation In memory the primary method of representing two-dimensional array is the row major representation. Under this representation, the primary row of the a

#question.explain different types of errors in data transmission.

Q.1 Write procedures/ Algorithm to insert and delete an element in to array. Q.2. Write an algorithm for binary search. What are the conditions under which sequential search of

Explain Optimal Binary Search Trees One of the principal application of Binary Search Tree is to execute the operation of searching. If probabilities of searching for elements