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

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. If there are more than 1 topological sorting of a DAG is possible, which of the following is true.

  • (A) Many Hamiltonian paths are possible
  • (B) No Hamiltonian path is possible
  • (C) Exactly 1 Hamiltonian path is possible
  • (D) Given information is insufficient to comment anything

A

Admin • 833.24K Points
Coach

Q. Which of the given statement is true?

  • (A) All the Cyclic Directed Graphs have topological sortings
  • (B) All the Acyclic Directed Graphs have topological sortings
  • (C) All Directed Graphs have topological sortings
  • (D) All the cyclic directed graphs have non topological sortings

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

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

  • (A) O(nlogn)
  • (B) O(logn)
  • (C) O(n)
  • (D) O(n2)

A

Admin • 833.24K Points
Coach

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

Admin • 833.24K Points
Coach

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

  • (A) O(nlogn)
  • (B) O(logn)
  • (C) O(n)
  • (D) O(n2)

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively are,

  • (A) 5 and 4
  • (B) 4 and 5
  • (C) 2 and 4
  • (D) 2 and 5

A

Admin • 833.24K Points
Coach

Q. The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of 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

A

Admin • 833.24K Points
Coach

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

  • (A) O(nlogn)
  • (B) O(logn)
  • (C) O(n)
  • (D) O(n2)

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