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

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. The number of comparisons required to sort 5 numbers in ascending order using bubble sort are

  • (A) 7
  • (B) 6
  • (C) 10
  • (D) 5

A

Admin • 833.24K Points
Coach

Q. A sorting algorithm is stable if

  • (A) its time complexity is constant irrespective of the nature of input
  • (B) preserves the original order of records with equal keys
  • (C) its space complexity is constant irrespective of the nature of input
  • (D) it sorts any volume of data in a constant time

A

Admin • 833.24K Points
Coach

Q. The average case complexity of Insertion Sort is

  • (A) o(2n)
  • (B) o(n3)
  • (C) o(n2)
  • (D) o(2n)

A

Admin • 833.24K Points
Coach

Q. A sorted file contains 16 items. Using binary search, the maximum number of comparisons to search for an item in this file is

  • (A) 15
  • (B) 8
  • (C) 1
  • (D) 4

A

Admin • 833.24K Points
Coach

Q. A sort which compares adjacent elements in a list and switches where necessary is

  • (A) insertion sort
  • (B) heap sort
  • (C) quick sort
  • (D) bubble sort

A

Admin • 833.24K Points
Coach

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) heap sort
  • (D) quick sort

A

Admin • 833.24K Points
Coach

Q. The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is

  • (A) 11
  • (B) 12
  • (C) 13
  • (D) 14

A

Admin • 833.24K Points
Coach

Q. A sorting technique that guarantees that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be

  • (A) stable
  • (B) consistent
  • (C) external
  • (D) linear

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

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

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