Design and Analysis of Algorithms MCQs with answers Page - 11

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. For any given sequence, there will ALWAYS be a unique increasing subsequence with the longest length.

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

A

Admin • 831.35K Points
Coach

Q. Given a rod of length n and the selling prices of all pieces smaller than equal to n, find the most beneficial way of cutting the rod into smaller pieces. This problem is called the rod cutting problem. Which of these methods can be used to solve the rod cutting problem?

  • (A) brute force
  • (B) dynamic programming
  • (C) recursion
  • (D) brute force, dynamic programming and recursion

A

Admin • 831.35K Points
Coach

Q. Consider the brute force implementation of the rod cutting problem in which all the possible cuts are found and the maximum value is calculated. What is the time complexity of this brute force implementation?

  • (A) o(n2)
  • (B) o(n3)
  • (C) o(nlogn)
  • (D) o(2n)

A

Admin • 831.35K Points
Coach

Q. For every rod cutting problem there will be a unique set of pieces that give the maximum price.

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

A

Admin • 831.35K Points
Coach

Q. For a given array, there can be multiple ways to reach the end of the array using minimum number of jumps.

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

A

Admin • 831.35K Points
Coach

Q. For any array, given that at most one element is non-zero, it is ALWAYS possible to reach the end of the array using minimum jumps.

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

A

Admin • 831.35K Points
Coach

Q. What is the space complexity of the following dynamic programming implementation used to find the minimum number of jumps?

  • (A) o(1)
  • (B) o(n)
  • (C) o(n2)
  • (D) o(5)

A

Admin • 831.35K Points
Coach

Q. The Knapsack problem is an example of

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

A

Admin • 831.35K Points
Coach

Q. Which of the following problems is equivalent to the 0-1 Knapsack problem?

  • (A) you are given a bag that can carry a maximum weight of w. you are given n items which have a weight of {w1, w2, w3,…., wn} and a value of {v1, v2, v3,…., vn}. you can break the items into smaller pieces. choose the items in such a way that y
  • (B) you are studying for an exam and you have to study n questions. the questions take {t1, t2, t3,…., tn} time(in hours) and carry {m1, m2, m3,…., mn} marks. you can study for a maximum of t hours. you can either study a question or leave it. c
  • (C) you are given infinite coins of denominations {v1, v2, v3,….., vn} and a sum s. you have to find the minimum number of coins required to get the sum s
  • (D) you are given a suitcase that can carry a maximum weight of 15kg. you are given 4 items which have a weight of {10, 20, 15,40} and a value of {1, 2, 3,4}. you can break the items into smaller pieces. choose the items in such a way that you get the maximum

A

Admin • 831.35K Points
Coach

Q. The 0-1 Knapsack problem can be solved using Greedy algorithm.

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