Site icon T4Tutorials.com

Collision resolution techniques (chaining, open addressing) MCQs

1. : What is a collision in hash tables?

(A) When two keys hash to the same index


(B) When a key is not found in the table


(C) When the hash table is full


(D) When the hash function fails



2. : Which collision resolution technique involves storing multiple entries at the same index?

(A) Open addressing


(B) Chaining


(C) Linear probing


(D) Double hashing



3. : What is the primary advantage of chaining over open addressing?

(A) Simplicity of implementation


(B) Better handling of load factors


(C) Faster lookup times


(D) Reduced memory usage



4. : In open addressing, what happens when a collision occurs?

(A) The new entry is discarded


(B) The existing entry is removed


(C) The algorithm searches for the next available slot


(D) The hash function is recalculated



5. : Which of the following is NOT a method of open addressing?

(A) Linear probing


(B) Quadratic probing


(C) Chaining


(D) Double hashing



6. : What happens in chaining when a bucket exceeds its limit?

(A) The bucket is resized


(B) The entries are sorted


(C) New entries are added to a linked list


(D) The old entries are deleted



7. : Which collision resolution technique can lead to primary clustering?

(A) Chaining


(B) Linear probing


(C) Quadratic probing


(D) Double hashing



8. : What is a common use of linked lists in the chaining method?

(A) To store entries in sorted order


(B) To handle collisions at a hash table index


(C) To improve search speed


(D) To reduce memory consumption



9. : In quadratic probing, how is the next slot calculated?

(A) By linearly increasing the index


(B) By using a quadratic function of the number of collisions


(C) By randomly selecting an index


(D) By doubling the index



10. : What is the disadvantage of chaining?

(A) Requires extra memory for pointers


(B) Slower than open addressing


(C) Complexity in implementation


(D) No significant disadvantages



11. : In which scenario is open addressing generally preferred?

(A) When memory overhead is a concern


(B) When dealing with a high load factor


(C) When frequent deletions occur


(D) When the hash function is complex



12. : What is the main goal of collision resolution techniques?

(A) To sort the entries


(B) To ensure unique keys


(C) To minimize retrieval time


(D) To handle situations where multiple keys hash to the same index



13. : Which technique allows for easier iteration over all elements in a hash table?

(A) Open addressing


(B) Chaining


(C) Linear probing


(D) Quadratic probing



14. : How does double hashing improve on linear probing?

(A) It reduces collisions by using a secondary hash function


(B) It requires less memory


(C) It guarantees faster access times


(D) It uses linked lists



15. : What does the term “load factor” refer to in hash tables?

(A) The ratio of used slots to total slots


(B) The number of collisions encountered


(C) The size of the hash table


(D) The complexity of the hash function



16. : Which of the following statements about open addressing is true?

(A) It cannot handle deletions effectively


(B) It uses additional memory for linked lists


(C) It can lead to clustering issues


(D) It is always faster than chaining



17. : What happens during a linear probing collision resolution?

(A) The next index is checked sequentially


(B) The bucket is resized


(C) A new hash function is applied


(D) The entry is deleted



18. : What is the main benefit of using quadratic probing?

(A) It guarantees no collisions


(B) It minimizes clustering compared to linear probing


(C) It is easier to implement


(D) It requires less memory



19. : In chaining, what is the structure commonly used to store multiple entries?

(A) Array


(B) Linked list


(C) Stack


(D) Queue



20. : What happens to the performance of open addressing as the load factor increases?

(A) It improves


(B) It remains constant


(C) It degrades


(D) It becomes unpredictable



21. : Which collision resolution technique is considered more space-efficient?

(A) Chaining


(B) Open addressing


(C) Linear probing


(D) Quadratic probing



22. : What is the key advantage of chaining in terms of performance?

(A) Faster search times


(B) Simplicity of implementation


(C) Less sensitive to load factor


(D) Lower memory requirements



23. : What happens in open addressing when the hash table is full?

(A) The table is resized


(B) The program crashes


(C) New entries cannot be added


(D) Collisions are ignored



24. : What is the primary disadvantage of open addressing?

(A) Complexity of implementation


(B) Memory overhead


(C) Performance degradation at high load factors


(D) Inefficient memory usage



25. : In which collision resolution method is each index potentially a linked list?

(A) Open addressing


(B) Quadratic probing


(C) Chaining


(D) Linear probing



26. : What is the best-case scenario for retrieval time in a hash table using chaining?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n²)



27. : Which of the following is a disadvantage of chaining?

(A) Potential for long linked lists


(B) More complex implementation than open addressing


(C) Greater memory overhead


(D) All of the above



28. : In which method do entries occupy contiguous memory locations?

(A) Chaining


(B) Open addressing


(C) Both A and B


(D) None of the above



29. : Which probing method adjusts the index based on a quadratic function?

(A) Linear probing


(B) Chaining


(C) Quadratic probing


(D) Double hashing



30. : What is a disadvantage of linear probing?

(A) It cannot handle deletions


(B) It can lead to clustering


(C) It uses more memory


(D) It is always slower than chaining



31. : What is the primary purpose of a secondary hash function in double hashing?

(A) To calculate the initial index


(B) To determine the next available index after a collision


(C) To reduce the memory overhead


(D) To encrypt the keys



32. : In which scenario is chaining particularly effective?

(A) When the load factor is low


(B) When there are many collisions


(C) When memory is constrained


(D) When deletions are frequent



33. : What is the typical time complexity for search operations in open addressing?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n²)



34. : Which of the following is an effective strategy to manage collisions in hash tables?

(A) Ignoring collisions


(B) Increasing the size of the table


(C) Using a chaining method


(D) Using multiple hash functions



35. : What factor can significantly affect the performance of collision resolution techniques?

(A) The choice of programming language


(B) The efficiency of the hash function


(C) The data types used


(D) The order of insertion



 

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

Exit mobile version