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

From 31 to 45 of 59

Q. What is the best case complexity of selection sort?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. Shell sort is also known as

a. diminishing decrement sort

b. diminishing increment sort

c. partition exchange sort

d. diminishing insertion sort

  • b. diminishing increment sort

Q. Statement 1: Shell sort is a stable sorting algorithm.Statement 2: Shell sort is an in-place sorting algorithm.

a. Both statements are true

b. Statement 2 is true but statement 1 is false

c. Statement 2 is false but statement 1 is true

d. none

  • b. Statement 2 is true but statement 1 is false

Q. Shell sort is applied on the elements 27 59 49 37 15 90 81 39 and the chosen decreasing sequence of increments is (5,3,1). The result after the first iteration will be

a. 27 59 49 37 15 90 81 39

b. 27 59 37 49 15 90 81 39

c. 27 59 39 37 15 90 81 49

d. 15 59 49 37 27 90 81 39

  • c. 27 59 39 37 15 90 81 49

Q. Shell sort is an improvement on

a. insertion sort

b. selection sort

c. binary tree sort

d. quick sort

  • a. insertion sort

Q. An array that is first 7-sorted, then 5-sorted becomes

a. 7-ordered

b. 5-ordered

c. both 2-ordered and 5-ordered

d. both 7-ordered and 5-ordered

  • d. both 7-ordered and 5-ordered

Q. Records R1, R2, R3,.. RN with keys K1, K2, K3,.. KN are said to be h-ordered, if

a. Ki <= Ki+h for 1<= i*h <= N

b. Kh <= Ki+h for 1<= i <= N

c. Ki <= Kh for 1<= i <= h

d. Ki <= Ki+h for 1<= i <= N-h

  • d. Ki <= Ki+h for 1<= i <= N-h

Q. Which of the following is true?

a. Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not completely sort the elements

b. Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap like in Comb sort

c. Comb sort’s passes completely sort the elements before going on to the next-smallest gap like in Shell sort

d. Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap while Comb sort’s passes completely sort the elements

  • a. Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not completely sort the elements

Q. Which of the following is the distribution sort?

a. Heap sort

b. Smooth sort

c. Quick sort

d. LSD radix sort

  • d. LSD radix sort

Q. What is the worst case time complexity of LSD radix sort?

a. O(nlogn)

b. O(wn)

c. O(n)

d. O(n + w)

  • b. O(wn)

Q. LSD radix sort requires passes to sort N elements.

a. (w/logR)

b. N(w/logR)

c. (w/log(RN))

d. (wN/log(N))

  • a. (w/logR)

Q. Which of the following is false?

a. LSD radix sort is an integer sorting algorithm

b. LSD radix sort is a comparison sorting algorithm

c. LSD radix sort is a distribution sort

d. LSD radix sort uses bucket sort

  • b. LSD radix sort is a comparison sorting algorithm

Q. Which of the following sorting algorithm is stable?

a. Heap sort

b. Selection sort

c. In-place MSD radix sort

d. LSD radix sort

  • d. LSD radix sort
Subscribe Now

Get All Updates & News