Top 80+ Solved Searching, Sorting and Hashing Techniques MCQ Questions Answer

From 46 to 59 of 59

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

  • c. LSD radix 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

  • a. Forward radix 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

  • b. accesses memory randomly

Q. Which scheme uses a randomization approach?

a. hashing by division

b. hashing by multiplication

c. universal hashing

d. open addressing

  • c. universal hashing

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)

  • a. h(k) = lowerbound(km)

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

  • b. h(k) = k mod m

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

  • a. Any prime number

Q. Which scheme provides good performance?

a. open addressing

b. universal hashing

c. hashing by division

d. hashing by multiplication

  • b. universal hashing

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)

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

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

  • c. value of m not critical

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)

  • a. Theta(n)
Subscribe Now

Get All Updates & News