Design and Analysis of Algorithms MCQs with answers Page - 37

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

Q. Which of the following is not true about subset sum problem?

  • (A) the recursive solution has a time complexity of o(2n)
  • (B) there is no known solution that takes polynomial time
  • (C) the recursive solution is slower than dynamic programming solution
  • (D) the dynamic programming solution has a time complexity of o(n log n)

A

Admin • 833K Points
Coach

Q. What is meant by the power set of a set?

  • (A) subset of all sets
  • (B) set of all subsets
  • (C) set of particular subsets
  • (D) an empty set

A

Admin • 833K Points
Coach

Q. What is the set partition problem?

  • (A) finding a subset of a set that has sum of elements equal to a given number
  • (B) checking for the presence of a subset that has sum of elements equal to a given number
  • (C) checking whether the set can be divided into two subsets of with equal sum of elements and printing true or false based on the result
  • (D) finding subsets with equal sum of elements

A

Admin • 833K Points
Coach

Q. Which of the following is true about the time complexity of the recursive solution of set partition problem?

  • (A) it has an exponential time complexity
  • (B) it has a linear time complexity
  • (C) it has a logarithmic time complexity
  • (D) it has a time complexity of o(n2)

A

Admin • 833K Points
Coach

Q. What is the worst case time complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?

  • (A) o(n)
  • (B) o(sum)
  • (C) o(n2)
  • (D) o(sum*n)

A

Admin • 833K Points
Coach

Q. Recursive solution of Set partition problem is faster than dynamic problem solution in terms of time complexity.

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

A

Admin • 833K Points
Coach

Q. What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?

  • (A) o(n log n)
  • (B) o(n2)
  • (C) o(2n)
  • (D) o(sum*n)

A

Admin • 833K Points
Coach

Q. Longest palindromic subsequence is an example of

  • (A) greedy algorithm
  • (B) 2d dynamic programming
  • (C) 1d dynamic programming
  • (D) divide and conquer

A

Admin • 833K Points
Coach

Q. Which of the following methods can be used to solve the edit distance problem?

  • (A) recursion
  • (B) dynamic programming
  • (C) both dynamic programming and recursion
  • (D) greedy algorithm

A

Admin • 833K Points
Coach

Q. The edit distance satisfies the axioms of a metric when the costs are non-negative.

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