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
13
16
14
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
Memoization
mapping
Storing value property
Longest palindromic subsequence is an example of ______________
1D dynamic programming
2D dynamic programming
Greedy Algorithm
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
3
4
5
6
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
none of the mentioned
prevFib = nextFibcurFib = prevFib
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(nlogm)
O(mn)
O(n+m)
O(1)
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(m + n)
O(m)
O(mn)
O(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;}
1430
42
132
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
Cannot be determined
none of the mentioned
4
What is the space complexity of the ABOVE recursive implementation
O(nlogn)
O(logn)
O(n!)
O(1)
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