Question 1
How many different insertion sequences of the key values using the hash function h(k) = k mod 10 and linear probing will result in the hash table shown below?
10
20
30
40
Question 2
Which of the following hash functions is most likely to cause clustering in a hash table?
h(k) = k % m
h(k) = floor(m * (kA mod 1))
h(k) = k
h(k) = ((k / m) + k * m) + k % m
Question 3
Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?
(97 × 97 × 97)/1003
(99 × 98 × 97)/1003
(97 × 96 × 95)/1003
(97 × 96 × 95)/(3! × 1003)
Question 4
Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to 2020?
h(i) = (12 ∗ i) mod 10
h(i) = (11 ∗ i2) mod 10
h(i) =i3 mod 10
h(i) =i2 mod 10
Question 5
Which of the following statement(s) is TRUE?
I only
II and III only
I and III only
II only
Question 6
Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed 0.5.
5
6
7
10
Question 7
What is the probability of a collision when hashing n keys into a hash table of size m, assuming that the hash function produces a uniform random distribution?
O(1/n)
O(n/m)
O(logn)
O(m/n)
Question 8
Insert the characters of the string K R P C S N Y T J M into a hash table of size 10. Use the hash function
h(x) = ( ord(x) – ord("A") + 1 ) mod10
If linear probing is used to resolve collisions, then the following insertion causes collision
Y
C
M
P
Question 9
What is the space used by programs when we use Hashmap in our program?
O(1)
O(LogN)
O(N)
None
Question 10
Which searching technique takes O(1) time complexity for searching the data?
Binary Search
Linear Search
AVL Tree Search
Hashing
There are 31 questions to complete.