MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is meant by collision in Hash Functions?
A
When 2 values use the same hash key
B
When 1 or more values use the same hash key
C
When there is not enough room in RAM
D
When the data bumps into each other
Explanation: 

Detailed explanation-1: -Definition: A collision occurs when more than one value to be hashed by a particular hash function hash to the same slot in the table or data structure (hash table) being generated by the hash function.

Detailed explanation-2: -In computer science, a hash collision or hash clash is when two pieces of data in a hash table share the same hash value. The hash value in this case is derived from a hash function which takes a data input and returns a fixed length of bits.

Detailed explanation-3: -Collision resolution techniques In separate chaining, each element of the hash table is a linked list. To store an element in the hash table you must insert it into a specific linked list. If there is any collision (i.e. two different elements have same hash value) then store both the elements in the same linked list.

Detailed explanation-4: -At the same time, two keys can also generate an identical hash. This phenomenon is called a collision.

Detailed explanation-5: -If you you used the same hash function for both operations, then there would only be a relatively small number of possible hash values for the keys in each hash table, because each partition is restricted to a small number of those hash values. This could lead to increased collisions and decreased efficiency.

There is 1 question to complete.