Design and Analysis of Algorithms MCQs with answers Page - 5

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 • 802.91K Points
Coach

Q. What is the auxiliary space complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?

  • (A) o(n + m)
  • (B) o(m)
  • (C) o(n)
  • (D) o(m * n)

A

Admin • 802.91K Points
Coach

Q. The naive pattern searching algorithm is an in place algorithm.

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

A

Admin • 802.91K Points
Coach

Q. Rabin Karp algorithm and naive pattern searching algorithm have the same worst case time complexity.

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

A

Admin • 802.91K Points
Coach

Q. Which of the following sorting algorithms is the fastest?

  • (A) merge sort
  • (B) quick sort
  • (C) insertion sort
  • (D) shell sort

A

Admin • 802.91K Points
Coach

Q. Quick sort follows Divide-and-Conquer strategy.

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

A

Admin • 802.91K Points
Coach

Q. What is the worst case time complexity of a quick sort algorithm?

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

A

Admin • 802.91K Points
Coach

Q. Which of the following methods is the most effective for picking the pivot element?

  • (A) first element
  • (B) last element
  • (C) median-of-three partitioning
  • (D) random element

A

Admin • 802.91K Points
Coach

Q. Which is the safest method to choose a pivot element?

  • (A) choosing a random element as pivot
  • (B) choosing the first element as pivot
  • (C) choosing the last element as pivot
  • (D) median-of-three partitioning method

A

Admin • 802.91K Points
Coach

Q. What is the average running time of a quick sort algorithm?

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

A

Admin • 802.91K Points
Coach

Q. Which of the following sorting algorithms is used along with quick sort to sort the sub arrays?

  • (A) merge sort
  • (B) shell sort
  • (C) insertion sort
  • (D) bubble 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