MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Sometimes a hash for a dictionary has duplicate entries. This is taken care of by
A
rehashing
B
deleting the data
C
asking for help
D
changing the hashing algorithm
Explanation: 

Detailed explanation-1: -It can be also defined as rehashing is the process of re-calculating the hash code of already stored entries and moving them to a bigger size hash map when the number of elements in the map reaches the maximum threshold value. In simple words, rehashing is the reverse of hashing process.

Detailed explanation-2: -Rehashing is done because whenever key-value pairs are inserted into the map, the load factor increases, which implies that the time complexity also increases as explained above. This might not give the required time complexity of O(1).

Detailed explanation-3: -Definition: A method of open addressing for a hash table in which a collision is resolved by searching the table for an empty place at intervals given by a different hash function, thus minimizing clustering. Also known as rehashing.

Detailed explanation-4: -One method for resolving collisions looks into the hash table and tries to find another open slot to hold the item that caused the collision. A simple way to do this is to start at the original hash value position and then move in a sequential manner through the slots until we encounter the first slot that is empty.

There is 1 question to complete.