Python Programming (2180711) MCQs

MCQs of Simple Algorithms and Data structures

Showing 21 to 29 out of 29 Questions
21.
What is a hash table?
(a) A structure that maps values to keys
(b) A structure that maps keys to values
(c) A structure used for storage
(d) A structure used to implement stack and queue
Answer:

Option (b)

22.
If several elements are competing for the same bucket in the hash table, what is it called?
(a) Diffusion
(b) Replication
(c) Collision
(d) Duplication
Answer:

Option (c)

23.
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) Same array position for all keys
Answer:

Option (a)

24.
What is a hash function?
(a) A function has allocated memory to keys
(b) A function that computes the location of the key in the array
(c) A function that creates an array
(d) A function that computes the location of the values in the array
Answer:

Option (b)

25.
Which of the following is not a technique to avoid a collision?
(a) Make the hash function appear random
(b) Use the chaining method
(c) Use uniform hashing
(d) Increasing hash table size
Answer:

Option (d)

26.
In simple chaining, what data structure is appropriate?
(a) Singly linked list
(b) Doubly linked list
(c) Circular linked list
(d) Binary trees
Answer:

Option (b)

27.
The case in which a key other than the desired one is kept at the identified location is called?
(a) Hashing
(b) Collision
(c) Chaining
(d) Open addressing
Answer:

Option (b)

28.
Which of the following is not a collision resolution technique?
(a) Separate chaining
(b) Linear probing
(c) Quadratic probing
(d) Hashing
Answer:

Option (d)

29.
Which of the following operations are done in a hash table?
(a) Insert only
(b) Search only
(c) Insert and search
(d) Replace
Answer:

Option (c)

Showing 21 to 29 out of 29 Questions