Top 350+ Solved Data Structure and Algorithms (DSA) MCQ Questions Answer
Q. You want to check whether a given set of items is sorted. Which of the following sorting methods will be most efficient if it is already in sorted order?
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
Q. Which of the following sorting methods will be the best if number of swappings done, is the only measure of efficienty?
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
Q. You are asked to sort 15 randomly generated numbers. You should prefer
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
Q. The smallest element of an array’s index is called its
a. lower bound
b. upper bound
c. range
d. extraction
Q. Which of the following sorting methods would be most suitable for sorting a list which is almost sorted
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
Q. A sort which compares adjacent elements in a list and switches wherever necessary is _______
a. insertion sort
b. bubble sort
c. selection sort
d. none of these
Q. Which of the following sorting method is the slowest?
a. quick sort
b. merge sort
c. bubble sort
d. none of these
Q. Consider that n elements are to be sorted.The worst case complexity of bubble sort is____
a. o(1)
b. o(log2n)
c. o(n)
d. o(n2)
Q. In bubble sort,for a file of size n,after p iterations number of records in proper position is____
a. n-p
b. n-p+1
c. n-p+2
d. p
Q. In bubble sort,for a file of size n,during each pth pass the number of last records left out are____
a. n-p
b. n-p+1
c. p
d. p-1
Q. Given a file size n the number of times a given file is passed through in bubble sort is____
a. n2
b. n-1
c. nlogn
d. logn
Q. A sort which iteratively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called
a. insertion sort
b. selection sort
c. bubble sort
d. merge sort