Engineering Questions with Answers - Multiple Choice Questions

# Hash Tables Chaining using Doubly Linked Lists Multiple Choice MCQ

1 - Question

Which of the following is used in hash tables to determine the index of any input record?
a) hash function
c) hash tree
d) hash chaining

Explanation: Hash table is an example of a data structure that is built for fast access of elements. Hash functions are used to determine the index of any input record in a hash table.

2 - Question

What is the advantage of a hash table as a data structure?
a) faster access of data
b) easy to implement
c) very efficient for less number of entries
d) exhibit good locality of reference

Explanation: Hash table is a data structure that has an advantage that it allows fast access of elements. Hash functions are used to determine the index of any input record in a hash table.

3 - Question

What is the use of a hash function?
a) to calculate and return the index of corresponding data
b) to store data
c) to erase data
d) to change data

Explanation: Hash function calculates and returns the index for corresponding data. This data is then mapped in a hash table.

4 - Question

What is the time complexity of insert function in a hash table using a doubly linked list?
a) O(1)
b) O(n)
c) O(log n)
d) O(n log n)

Explanation: Time complexity of insert function in a hash table is O(1). Condition is that the number of collisions should be low.

5 - Question

What is the time complexity of search function in a hash table using a doubly linked list?
a) O(1)
b) O(n)
c) O(log n)
d) O(n log n)

Explanation: Time complexity of search function in a hash table is O(1). Condition is that the number of collisions should be low.

6 - Question

What is the time complexity of delete function in the hash table using a doubly linked list?
a) O(1)
b) O(n)
c) O(log n)
d) O(n log n)

Explanation: Time complexity of delete function in a hash table is O(1). Condition is that the hash function should be such that the number of collisions should be low.

7 - Question

Hashing can be used to encrypt and decrypt digital signatures.
a) true
b) false

Explanation: Hashing is also used in encryption algorithms. It is used for encryption and decryption of digital signatures.

8 - Question

a) it takes less memory
b) it is easy to implement
c) it makes the process of insertion and deletion faster
d) it causes less collisions

Explanation: Using a doubly linked list reduces time complexity significantly. Though it uses more memory to store the extra pointer.

9 - Question

Which of the following technique stores data in the hash table itself in case of a collision?
c) Chaining using doubly linked list
d) Chaining using binary tree

Explanation: Open addressing is used to store data in the table itself in case of a collision. Whereas chaining stores data in a separate entity.

10 - Question

Which of the following technique stores data in a separate entity in case of a collision?
b) Chaining using doubly linked list
c) Linear probing
d) Double hashing

Explanation: Chaining using doubly linked list is used to store data in a separate entity (doubly linked list in this case) in case of a collision. Whereas open addressing stores it in the table itself.

11 - Question

Collision is caused due to the presence of two keys having the same value.
a) True
b) False