# 500+ Hash Tables (Data Structure) MCQs with FREE PDF

This Hash Tables MCQs and answer with FREE PDF contains multiple choice questions and answers on hash tables, direct addressing tables, hash tables chaining using linked lists, doubly linked lists, binary trees and list heads, hash tables with linear and quadratic probing, hashing functions, hash tree, min hash and double hashing. We have the best collection of Hash Tables MCQs and answer with FREE PDF. These Hash Tables MCQs will help you to prepare for any competitive exams like: BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

## Hash Tables (Data Structure) MCQs

a) 6

b) 7

c) 17

d) 16

a) 0.5

b) 1

c) 1.5

d) 2

#### 3. Which of the following operations are done in a hash table?

a) Insert only

b) Search only

c) Insert and search

d) Replace

Answer: Insert and search

b) Array

c) Stack

d) Queue

#### 5. Which of the following is the hashing function for separate chaining?

a) H(x)=(hash(x)+f(i)) mod table size

b) H(x)=hash(x)+i2 mod table size

c) H(x)=x mod table size

d) H(x)=x mod (table size * 2)

Answer: H(x)=x mod table size

a) Ω

b) ∞

c) ∑

d) ⅄

a) 1+⅄

b) 1+⅄2

c) 1+ (⅄/2)

d) ⅄3

#### 8. Which of the following is a disadvantage of using separate chaining using linked lists?

a) It requires many pointers

b) It requires linked lists

c) It uses array

d) It does not resolve collision

Answer: It requires many pointers

#### 9. What is the worst case search time of a hashing using separate chaining algorithm?

a) O(N log N)

b) O(N)

c) O(N2)

d) O(N3)

50+ Hash Tables Chaining using Linked Lists MCQs PDF Download

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

a) true

b) false

#### 13. What is the advantage of using a doubly linked list for chaining over singly linked list?

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

Answer: it makes the process of insertion and deletion faster

#### 14. Which of the following technique stores data in the hash table itself in case of a collision?

b) Chaining using linked list

c) Chaining using doubly linked list

d) Chaining using binary tree

#### 15. 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

50+ Hash Tables Chaining using Doubly Linked Lists MCQs PDF Download

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

#### 18. What is the advantage of a hash table over BST?

a) hash table has a better average time complexity for performing insert, delete and search operations

b) hash table requires less space

c) range query is easy with hash table

d) easier to implement

Answer: hash table has a better average time complexity for performing insert, delete and search operations

#### 19. What is the disadvantage of BST over the hash table?

a) BST is easier to implement

b) BST can get the keys sorted by just performing inorder traversal

c) BST can perform range query easily

d) Time complexity of hash table in inserting, searching and deleting is less than that of BST

Answer: Time complexity of hash table in inserting, searching and deleting is less than that of BST

#### 20. Which of the following technique stores data separately in case of a collision?

b) Double hashing

d) Chaining using a binary tree

Answer: Chaining using a binary tree

a) true

b) false

#### 22. Which of the following variant of a hash table has the best cache performance?

a) hash table using a linked list for separate chaining

b) hash table using binary search tree for separate chaining

c) hash table using open addressing

d) hash table using a doubly linked list for separate chaining

50+ Hash Tables Chaining with Binary Trees MCQs PDF Download

a) True

b) False

a) F(i)= 1

b) F(i)=i

c) F(i)=i2

d) F(i)=i+1

a) Hashing

b) Clustering

c) Rehashing

d) Collision

#### 26. What is the hash function used in linear probing?

a) H(x)= key mod table size

b) H(x)= (key+ F(i2)) mod table size

c) H(x)= (key+ F(i)) mod table size

d) H(x)= X mod 17

Answer: H(x)= (key+ F(i)) mod table size

a) True

b) False

#### 28. Which of the following problems occur due to linear probing?

a) Primary collision

b) Secondary collision

c) Separate chaining

d) Extendible hashing

50+ Hash Tables with Linear Probing MCQs PDF Download

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

a) O(1)

b) O(n)

c) O(log n)

d) O(n log n)

#### 31. Which of the following trait of a hash function is most desirable?

a) it should cause less collisions

b) it should cause more collisions

c) it should occupy less space

d) it should be easy to implement

Answer: it should cause less collisions

#### 32. What is the advantage of using linked list over the doubly linked list for chaining?

a) it takes less memory

b) it causes more collisions

c) it makes the process of insertion and deletion faster

d) it causes less collisions

Answer: it takes less memory

a) O(1)

b) O(n log n)

c) O(log n)

d) O(n)

#### 34. Which of the following technique is used for handling collisions in a hash table?

b) Hashing

c) Searching

d) Hash function

50+ Hash Tables Chaining with List Heads MCQs PDF Download

a) 1

b) 2

c) 3

d) 4

#### 36. Which among the following is the best technique to handle collision?

b) Linear probing

c) Double hashing

d) Separate chaining

#### 37. Which of the following techniques offer better cache performance?

b) Linear probing

c) Double hashing

d) Rehashing

#### 38. What is the formula used in quadratic probing?

a) Hash key = key mod table size

b) Hash key=(hash(x)+F(i)) mod table size

c) Hash key=(hash(x)+F(i2)) mod table size

d) H(x) = x mod 17

Answer: Hash key=(hash(x)+F(i2)) mod table size

#### 39. Which of the following schemes does quadratic probing come under?

a) rehashing

b) extended hashing

c) separate chaining

a) True

b) False

#### 41. What can be the value of m in the division method?

a) Any prime number

b) Any even number

c) 2p – 1

d) 2p

Answer: Any prime number

#### 42. Which scheme provides good performance?

b) universal hashing

c) hashing by division

d) hashing by multiplication

a) 19

b) 72

c) 15

d) 17

a) 1

b) 4

c) 3

d) 2

#### 45. What is the hash function used in multiplication method?

a) h(k) = floor( m(kA mod 1))

b) h(k) = ceil( m(kA mod 1))

c) h(k) = floor(kA mod m)

d) h(k) = ceil( kA mod m)

Answer: h(k) = floor( m(kA mod 1))

#### 46. What is the advantage of the multiplication method?

a) only 2 steps are involved

b) using constant

c) value of m not critical

d) simple multiplication

Answer: value of m not critical

a) 14

b) 128

c) 49

d) 127

#### 48. What is the value of h(k) for the key 123456?

Given: p=14, s=2654435769, w=32

a) 123

b) 456

c) 70

d) 67

#### 49. Which technique has the greatest number of probe sequences?

a) Linear probing

c) Double hashing

d) Closed hashing

a) 11

b) 18

c) 17

d) 15

a) True

b) False

a) True

b) False

#### 53. What is the hash function used in Double Hashing?

a) (h1(k) – i*h2(k))mod m

b) h1(k) + h2(k)

c) (h1(k) + i*h2(k))mod m

d) (h1(k) + h2(k))mod m

Answer: (h1(k) + i*h2(k))mod m

a) c1

b) k

c) c2

d) m

a) Merkle tree

b) T -tree

c) Hash table

d) Bx-tree

a) 3

b) 5

c) 4

d) 6

#### 57. Where is the hash tree used?

a) in digital currency

b) in sorting of large data

c) for indexing in databases

d) in encryption of data

Answer: in digital currency

a) O(logk(n))

b) O(n2)

c) O(nlogk(n))

d) O(kn)

a) True

b) False

a) O(logn)

b) O(n2)

c) O(nlogn)

d) O(n)

a) Heap

b) Hash list

c) BST

d) B – tree

a) True

b) False

#### 63. Which indicator is used for similarity between two sets?

a) Rope Tree

b) Jaccard Coefficient

c) Tango Tree

d) MinHash Coefficient

#### 64. Which of the following is defined as the ratio of total elements of intersection and union of two sets?

a) Rope Tree

b) Jaccard Coefficient Index

c) Tango Tree

d) MinHash Coefficient

Answer: Jaccard Coefficient Index

a) 1

b) 2

c) 3

d) 0

#### 66. When are the members of two sets more common relatively?

a) Jaccard Index is Closer to 1

b) Jaccard Index is Closer to 0

c) Jaccard Index is Closer to -1

d) Jaccard Index is Farther to 1

Answer: Jaccard Index is Closer to 1

a) O (log k!)

b) O (k!)

c) O (k2)

d) O (1/k½)

a) 100

b) 200

c) 300

d) 400

a) O (log k!)

b) O (k!)

c) O (k2)

d) O (1/k½)

#### 70. What is the advantage of using a dynamic set in direct addressing?

a) It saves time

b) It saves space

c) It saves both time and space

d) It reduces code complexity

Answer: It saves space

a) O(n)

b) O(logn)

c) O(nlogn)

d) O(1)

#### 72. How is a bit vector better compared to a normal array for implementing the hash table?

a) It saves time

b) It saves space

c) It saves both time and space

d) It reduces code complexity

Answer: It saves space

#### 73. What is direct addressing?

a) Distinct array position for every possible key

b) Fewer array positions than keys

c) Fewer keys than array positions

d) Distinct array positions for keys based on priority

Answer: Distinct array position for every possible key

#### 74. When is it appropriate to use direct addressing?

a) When the array is comparatively large

b) When the universe U of keys is reasonably small

c) When the universe U of keys is reasonably large

d) When the array is comparatively small

Answer: When the universe U of keys is reasonably small

a) O(n)

b) O(logn)

c) O(nlogn)

d) O(1)