Top 80+ Solved Searching, Sorting and Hashing Techniques MCQ Questions Answer
Q. Which of the following should be used to sort a huge database on a fixed-length key field?
a. Insertion sort
b. Merge sort
c. LSD radix sort
d. Quick sort
Q. Which of the following is a combination of LSD and MSD radix sorts?
a. Forward radix sort
b. 3-way radix quick sort
c. Trie base radix sort
d. Flash sort
Q. Which of the following is true for the LSD radix sort?
a. works best for variable length strings
b. accesses memory randomly
c. inner loop has less instructions
d. sorts the keys in left-to-right order
Q. Which scheme uses a randomization approach?
a. hashing by division
b. hashing by multiplication
c. universal hashing
d. open addressing
Q. Which hash function satisfies the condition of simple uniform hashing?
a. h(k) = lowerbound(km)
b. h(k)= upperbound(mk)
c. h(k)= lowerbound(k)
d. h(k)= upperbound(k)
Q. What is the hash function used in the division method?
a. h(k) = k/m
b. h(k) = k mod m
c. h(k) = m/k
d. h(k) = m mod k
Q. What can be the value of m in the division method?
a. Any prime number
b. Any even number
c. 2p – 1
d. 2p
Q. Which scheme provides good performance?
a. open addressing
b. universal hashing
c. hashing by division
d. hashing by multiplication
Q. 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)
Q. 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
Q. What is the table size when the value of p is 7 in multiplication method of creating hash functions?
a. 14
b. 128
c. 49
d. 127
Q. What is the average retrieval time when n keys hash to the same slot?
a. Theta(n)
b. Theta(n2)
c. Theta(nlog n)
d. Big-Oh(n2)