Question 36

Computer Awareness Hashing Easy

All the elements that hash to the same slot are placed into the same linked list in:

(A) Universal hashing
(B) Linear Probing
(C) Quadratic probing
(D) Chaining
View Dynamic Solution & Explanation
Correct Solution: Option D

Step-by-step Solution:

Question: All the elements that hash to the same slot are placed into the same linked list in:

  1. Universal hashing
  2. Linear Probing
  3. Quadratic probing
  4. Chaining

Solution: (D) Chaining

Explanation:

In hashing, when two or more keys are mapped to the same slot (called a collision), we need a technique to handle it.

  • Linear Probing – Handles collisions by placing the new key in the next available slot (causes clustering).
  • Quadratic Probing – Uses a quadratic function to find the next slot (reduces clustering but still uses open addressing).
  • Universal Hashing – Refers to a class of hash functions chosen randomly to reduce collisions.
  • Chaining – Handles collisions by maintaining a linked list at each slot, where all elements that hash to the same slot are stored.

Hence, the correct answer is: Chaining.