Foxoyo
Hey..!!
Data Structure Dynamic Programming
Practice
MCQs
Quizzes
About
Leaderboard
Amazon Books
12
MCQs
0
Attempts
0 %
Accuracy
share
Filter by
Type here
Apply
Consider the 3×3 matrix {{2,1,-3},{6,3,4},{-2,3,0}}. What is the sum of the elements of the maximum sum rectangle
16
14
13
19
What is the space complexity of the above dynamic programming implementation of the balanced partition problem
O(sum)
O(sum * n)
O(sum + n)
O(n)
In dynamic programming, the technique of storing the previously calculated values is called ___________
Storing value property
Memoization
Saving value property
mapping
Longest palindromic subsequence is an example of ______________
Divide and conquer
2D dynamic programming
Greedy Algorithm
1D dynamic programming
You are given infinite coins of denominations 1, 3, 4. What is the total number of ways in which a sum of 7 can be achieved using these coins if the order of the coins is not important
6
4
5
3
Consider the following code to find the nth fibonacci term:int fibo(int n) if n == 0 return 0 else prevFib = 0 curFib = 1 for i : 1 to n-1 nextFib = prevFib + curFib __________ __________ return curFibComplete the above code
none of the mentioned
prevFib = curFibcurFib = nextFib
prevFib = nextFibcurFib = prevFib
prevFib = curFib curFib = curFib
What is the space complexity of the above implementation of Wagner–Fischer algorithm where “m” and “n” are the lengths of the two strings
O(1)
O(n+m)
O(nlogm)
O(mn)
What is the time complexity of the above dynamic programming implementation of the longest common subsequence problem where length of one string is “m” and the length of the other string is “n”
O(n)
O(m + n)
O(m)
O(mn)
What is the output of the following code?#includeint cat_number(int n){ int i,j,arr[n],k; arr[0] = 1; for(i = 1; i < n; i++) { arr[i] = 0; for(j = 0,k = i - 1; j < i; j++,k--) arr[i] += arr[j] * arr[k]; } return arr[n-1];}int main(){ int ans, n = 8; ans = cat_number(n); printf("%d\n",ans); return 0;}
1430
42
132
429
What is the space complexity of Kadane’s algorithm
none of the mentioned
O(n2)
O(n)
O(1)
Consider the two strings “”
(empty string) and “abcd”. What is the edit distance between the two strings
none of the mentioned
4
Cannot be determined
What is the space complexity of the ABOVE recursive implementation
O(1)
O(n!)
O(logn)
O(nlogn)
1
take a quick Quiz
Practice mcqs on Data Structure Dynamic Programming
Let's start
pick difficulty level
all
1
2
3
4
5
12
Mcqs
0
attempts
0
followers
Related Topics
Data Structure Dynamic Programming
Data Structure Abstract Data Types
R Programming R Profiling Simulation and Data Ana
R Programming R Data Storage Formats Objects and
R Programming R Nuts and Bolts and Getting Data I
Data Structure
Data Structure Recursion
Data Structure Binary Trees
Data Structure Arrays Types
Data Structure Heap
Suggested Books