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 * n)
O(sum)
O(sum + n)
O(n)
In dynamic programming, the technique of storing the previously calculated values is called ___________
Saving value property
mapping
Memoization
Storing value property
Longest palindromic subsequence is an example of ______________
1D dynamic programming
Greedy Algorithm
2D dynamic programming
Divide and conquer
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
5
3
6
4
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
prevFib = curFibcurFib = nextFib
prevFib = curFib curFib = curFib
prevFib = nextFibcurFib = prevFib
none of the mentioned
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(n+m)
O(1)
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)
O(mn)
O(m + n)
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;}
42
132
1430
429
What is the space complexity of Kadane’s algorithm
O(n2)
O(n)
none of the mentioned
O(1)
Consider the two strings “”
(empty string) and “abcd”. What is the edit distance between the two strings
4
none of the mentioned
Cannot be determined
What is the space complexity of the ABOVE recursive implementation
O(logn)
O(1)
O(nlogn)
O(n!)
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
Javascript is disabled
we serve best when javscript is enabled
Enable