Unit2 Hashing
Unit2 Hashing
Answer: b
2. 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: c
Answer: a
a) O(n)
b) O(logn)
c) O(nlogn)
d) O(1)
Answer: d
Explanation: In a hash table, there are fewer array positions than the
keys, so the position of the key in the array has to be computed, this is
done using the hash function.
Answer: d
Answer: c
Answer: a
a) O(n)
b) O(logn)
c) O(nlogn)
d) O(1)
Answer: d
Explanation: There are two cases, once when the search is successful
and when it is unsuccessful, but in both cases, the complexity is
O(1+alpha) where 1 is to compute the hash function and alpha is the
load factor.
10. In simple chaining, what data structure is appropriate?
d) Binary trees
Answer: b
11. How many different insertion sequences of the key values using the
same hash function and linear probing will result in the hash table
shown above?
A. 10
B. 20
C. 30
D. 40
Ans : C
A. It saves time
B. It saves space
Ans: B
a. Separate chaining
b. Double hashing
c. Linear probing
d. Quadratic probing
Answer: (d)
14. Which one is the most desirable out of these traits of a hash
function?
Answer: D
Answer: A
D. Binary trees
Answer: B
A. It saves time
B. It saves space
Answer: B