Top 150+ Solved Design and Analysis of Algorithms MCQ Questions Answer
Q. Recursion is similar to which of the following?
a. switch case
b. loop
c. if-else
d. if elif else
Q. Recursion is a method in which the solution of a problem depends on
a. larger instances of different problems
b. larger instances of the same problem
c. smaller instances of the same problem
d. smaller instances of different problems
Q. Which of the following problems can’t be solved using recursion?
a. factorial of a number
b. nth fibonacci number
c. length of a string
d. problems without base case
Q. What is the space complexity of Kadane’s algorithm?
a. o(1)
b. o(n)
c. o(n2)
d. none of the mentioned
Q. The longest increasing subsequence problem is a problem to find the length of a subsequence from a sequence of array elements such that the subsequence is sorted in increasing order and it’s length is maximum. This problem can be solved using
a. recursion
b. dynamic programming
c. brute force
d. recursion, dynamic programming, brute force
Q. What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence?
a. o(1)
b. o(2n)
c. o(n)
d. o(n2)
Q. The dynamic programming implementation of the maximum sum rectangle problem uses which of the following algorithm?
a. hirschberg’s algorithm
b. needleman-wunsch algorithm
c. kadane’s algorithm
d. wagner fischer algorithm
Q. Given an array, check if the array can be divided into two subsets such that the sum of elements of the two subsets is equal. This is the balanced partition problem. Which of the following methods can be used to solve the balanced partition problem?
a. dynamic programming
b. recursion
c. brute force
d. dynamic programming, recursion, brute force
Q. In which of the following cases, it is not possible to have two subsets with equal sum?
a. when the number of elements is odd
b. when the number of elements is even
c. when the sum of elements is odd
d. when the sum of elements is even
Q. What is the time complexity of the brute force algorithm used to solve the balanced partition problem?
a. o(1)
b. o(n)
c. o(n2)
d. o(2n)
Q. A simple acyclic path between source and sink which pass through only positive weighted edges is called?
a. augmenting path
b. critical path
c. residual path
d. maximum path
Q. In a bipartite graph G=(V,U,E), the matching of a free vertex in V to a free vertex in U is called?
a. bipartite matching
b. cardinality matching
c. augmenting
d. weight matching
Q. Which of the following is also known as LCM?
a. lowest common divisor
b. least common multiple
c. lowest common measure
d. highest common multiple
Q. What is the LCM of two coprime numbers?
a. 1
b. 0
c. addition of two coprime numbers
d. multiplication of two coprime numbers