Data Structure and Algorithms (DSA) MCQs with answers Page - 22

Here, you will find a collection of MCQ questions on Data Structure and Algorithms (DSA). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. Which of the following sorting method is the slowest?

  • (A) quick sort
  • (B) merge sort
  • (C) bubble sort
  • (D) none of these

A

Admin • 833.24K Points
Coach

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)

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. Total number of comparision in bubble sort is____

  • (A) o(nlogn)
  • (B) o(n2)
  • (C) o(n)
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. The selection sort is basically a method of repeated

  • (A) interchange
  • (B) searching
  • (C) position adjustment
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. In selection sort of n elements,how many times is the swp function called in the complete execution of the algorithm?

  • (A) 1
  • (B) n-1
  • (C) n(n-1)/2
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. If two string are identical then strcmp() function returns____

  • (A) -1
  • (B) 1
  • (C) 0
  • (D) none of these

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ