Design and Analysis of Algorithms MCQs with answers Page - 16

Here, you will find a collection of MCQ questions on Design and Analysis of Algorithms. 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 • 831.35K Points
Coach

Q. What is the time complexity of the program to reverse stack when linked list is used for its implementation?

  • (A) o(n)
  • (B) o(n log n)
  • (C) o(n2)
  • (D) o(log n)

A

Admin • 831.35K Points
Coach

Q. Which of the following takes O(n) time in worst case in array implementation of stack?

  • (A) pop
  • (B) push
  • (C) isempty
  • (D) pop, push and isempty takes constant time

A

Admin • 831.35K Points
Coach

Q. What will be the time complexity of the code to reverse stack recursively?

  • (A) o(n)
  • (B) o(n log n)
  • (C) o(log n)
  • (D) o(n2)

A

Admin • 831.35K Points
Coach

Q. Which of the following sorting algorithm has best case time complexity of O(n2)?

  • (A) bubble sort
  • (B) selection sort
  • (C) insertion sort
  • (D) stupid sort

A

Admin • 831.35K Points
Coach

Q. Which of the following is the biggest advantage of selection sort?

  • (A) its has low time complexity
  • (B) it has low space complexity
  • (C) it is easy to implement
  • (D) it requires only n swaps under any condition

A

Admin • 831.35K Points
Coach

Q. What will be the recurrence relation of the code of recursive selection sort?

  • (A) t(n) = 2t(n/2) + n
  • (B) t(n) = 2t(n/2) + c
  • (C) t(n) = t(n-1) + n
  • (D) t(n) = t(n-1) + c

A

Admin • 831.35K Points
Coach

Q. Which of the following sorting algorithm is NOT stable?

  • (A) selection sort
  • (B) brick sort
  • (C) bubble sort
  • (D) merge sort

A

Admin • 831.35K Points
Coach

Q. What will be the best case time complexity of recursive selection sort?

  • (A) o(n)
  • (B) o(n2)
  • (C) o(log n)
  • (D) o(n log n)

A

Admin • 831.35K Points
Coach

Q. Recursive selection sort is a comparison based sort.

  • (A) true
  • (B) false
  • (C) ---
  • (D) ---

A

Admin • 831.35K Points
Coach

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

  • (A) o(n)
  • (B) o(n log n)
  • (C) o(n2)
  • (D) o(log n)