Top 350+ Solved Data Structures (DS) MCQ Questions Answer

From 346 to 360 of 370

Q. In the following scenarios, when will you use selection sort?

a. The input is already sorted

b. A large file has to be sorted

c. Large values need to be sorted with small keys

d. Small values need to be sorted with large keys

  • c. Large values need to be sorted with small keys

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

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. What is the advantage of selection sort over other sorting techniques?

a. It requires no additional storage space

b. It is scalable

c. It works best for inputs which are already sorted

d. It is faster than any other sorting technique

  • a. It requires no additional storage space

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

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. What is the disadvantage of selection sort?

a. It requires auxiliary memory

b. It is not scalable

c. It can be used for small keys8

d. It takes linear time to sort the elements

  • b. It is not scalable

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
Subscribe Now

Get All Updates & News