Dynamic Programming Mcqs
Our collections of Multiple choice questions and answers focuses on study of ” Dynamic Programming ” in Data Structures. These questions are chosen from a collection of most authoritative and best reference books on Data Structures. Our aim is to prepare an individual for competitive exams like NTS | GAT | ECAT | Data Warehouse jobs | Data Mining | DB administration jobs Software House and Computer Programmer jobs | University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate knowledge on Dynamic Programming comprehensively.
32. Consider the two matrices P and Q which are 10 x 20 and 20 x 30 matrices respectively. What is the number of multiplications required to multiply the two matrices?
10*20
20*30
10*30
10*20*30
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
33. Consider the two strings “”(empty string) and “abcd”. What is the edit distance between the two strings?
0
4
None of the mentioned
Cannot be determined
34. Fill in the blank to complete the code.
Lookup[tmp] = min_coins
Min_coins = lookup[tmp]
Break
Continue
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
35. Find the length of the longest increasing subsequence for the given sequence: {-10, 24, -9, 35, -21, 55, -41, 76, 84}
5
4
3
6
36. Find the longest increasing subsequence for the given sequence: {10, -10, 12, 9, 10, 15, 13, 14}
{10, 12, 15}
{10, 12, 13, 14}
{-10, 12, 13, 14}
{-10, 9, 10, 13, 14}
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
37. Find the maximum sub-array sum for the following array: {3, 6, 7, 9, 3, 8}
33
36
23
26
38. Find the maximum sub-array sum for the given elements. {-2, -1, -3, -4, -1, -2, -1, -5, -4}
-3
5
3
-1
39. Find the maximum sub-array sum for the given elements. {2, -1, 3, -4, 1, -2, -1, 5, -4}
3
5
8
6
40. For which of the following inputs would Kadane’s algorithm produce a WRONG output?
{1,0,-1}
{-1,-2,-3}
{1,2,3}
{0,0,0}
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
41. For which of the following inputs would Kadane’s algorithm produce the CORRECT output?
{0,1,2,3}
{-1,0,1}
{-1,-2,-3,0}
All of the mentioned
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
42. For which of the following pairs of strings is the edit distance maximum?
Sunday & monday
Monday & tuesday
Tuesday & wednesday
Wednesday & thursday
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
43. For which of the following, the length of the string is equal to the length of the longest palindromic subsequence?
A string that is a palindrome
A string of length one
A string that has all the same letters(e.g. aaaaaa)
All of the mentioned
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
44. Given a one-dimensional array of integers, you have to find a sub-array with maximum sum. This is the maximum sub-array sum problem. Which of these methods can be used to solve the problem?
Dynamic programming
Two for loops (naive method)
Divide and conquer
All of the mentioned
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
45. 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?
Brute force
Dynamic programming
Recursion
All of the mentioned
Answer & Solution
No Solution for this Answer..! Report or Discus this Question