Top 150+ Solved Design and Analysis of Algorithms MCQ Questions Answer

From 91 to 105 of 152

Q. Under what condition any set A will be a subset of B?

a. if all elements of set b are also present in set a

b. if all elements of set a are also present in set b

c. if a contains more elements than b

d. if b contains more elements than a

  • b. if all elements of set a are also present in set b

Q. What is a subset sum 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 and printing true or false based on the result

c. finding the sum of elements present in a set

d. finding the sum of all the subsets of a set

  • b. checking for the presence of a subset that has sum of elements equal to a given number and printing true or false based on the result

Q. Which of the following is true about the time complexity of the recursive solution of the subset sum 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. it has an exponential time complexity

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)

  • d. the dynamic programming solution has a time complexity of o(n log n)

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

  • b. set of all subsets

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

  • 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

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. it has an exponential time complexity

Q. Master’s theorem is used for?

a. solving recurrences

b. solving iterative relations

c. analysing loops

d. calculating the time complexity of any code

  • a. solving recurrences
Subscribe Now

Get All Updates & News