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
How many recursive calls are called by the naïve recursive algorithm for binomial coefficients, C(10, 5) and C(21, 12) C(n,k){c(n-1,k)+c(n-1,k-1) if 1 1 if k = n or k = 0

A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is called as a   Queue.

Let a be a well-formed formula. Let c be the number of binary logical operators in a. (Recall that ?, ?, ?, and ? are the binary logical operators). Let s be the number of proposit

Explain the Abstract data type assertions Generally, ADT assertions translate into assertions about the data types which implement ADTs, which helps insure that our ADT impleme

Evaluate the frequency counts for all statements in the following given program segment. for (i=1; i ≤ n; i ++) for (j = 1; j ≤ i; j++) for (k =1; k ≤ j; k++) y ++;

I am looking for assignment help on the topic Data Structures. It would be great if anyone help me.

what is tree

Here is a diagram showing similarities between documents; this is an actual set of physics lab assignments from a large university. Each node (square) in the graph is a doc

In the book the following methods are presented: static void selectionSort(Comparable[] list) static void insertionSort(Comparable[] list) static boolean linearSearch(Comparable

Q. Explain various graph traversal schemes and write their advantages and disadvantages. A n s . Graph Traversal Scheme is explained below In many troubles we wish