Top 80+ Solved Searching, Sorting and Hashing Techniques MCQ Questions Answer
Q. The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The numberof iterations in selection sort and bubble sort respectively are,
a. 5 and 4
b. 1 and 4
c. 0 and 4
d. 4 and 1
Q. Shell sort is also known as
a. diminishing decrement sort
b. diminishing increment sort
c. partition exchange sort
d. diminishing insertion 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
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
Q. Shell sort is an improvement on
a. insertion sort
b. selection sort
c. binary tree sort
d. quick 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
Q. If Hibbard increments (h1= 1, h2= 3, h3= 7, …, hk = 2k–1) are used in a Shell sortimplementation, then the best case time complexity will be
a. O(nlogn)
b. O(n)
c. O(n2)
d. O(logn)
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
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
Q. Which of the following is the distribution sort?
a. Heap sort
b. Smooth sort
c. Quick 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)
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))
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
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