Dynamic Programming
Question 1 |
Bellman–Ford Algorithm for single source shortest path | |
Floyd Warshall Algorithm for all pairs shortest paths | |
0-1 Knapsack problem | |
Prim's Minimum Spanning Tree |
Discuss it
Question 2 |
We need an optimal solution | |
The solution has optimal substructure | |
The given problem can be reduced to the 3-SAT problem | |
It's faster than Greedy |
Discuss it
Question 3 |
Which of the following statements is TRUE?
The algorithm uses dynamic programming paradigm | |
The algorithm has a linear complexity and uses branch and bound paradigm | |
The algorithm has a non-linear polynomial complexity and uses branch and bound paradigm | |
The algorithm uses divide and conquer paradigm. |
Discuss it
Question 4 |
Maximum sum subsequence in an array | |
Maximum sum subarray in an array | |
Maximum product subsequence in an array | |
Maximum product subarray in an array |
Discuss it
Question 5 |
248000 | |
44000 | |
19000 | |
25000 |
Discuss it
Question 6 |
X[i, j] = X[i - 1, j] ∨ X[i, j -ai] | |
X[i, j] = X[i - 1, j] ∨ X[i - 1, j - ai] | |
X[i, j] = X[i - 1, j] ∧ X[i, j - ai] | |
X[i, j] = X[i - 1, j] ∧ X[i -1, j - ai] |
Discuss it
Question 7 |
X[1, W] | |
X[n ,0] | |
X[n, W] | |
X[n -1, n] |
Discuss it
Question 8 |
l(i,j) = 0, if either i=0 or j=0
= expr1, if i,j > 0 and X[i-1] = Y[j-1]
= expr2, if i,j > 0 and X[i-1] != Y[j-1]
expr1 ≡ l(i-1, j) + 1 | |
expr1 ≡ l(i, j-1) | |
expr2 ≡ max(l(i-1, j), l(i, j-1)) | |
expr2 ≡ max(l(i-1,j-1),l(i,j)) |
Discuss it
1) The last characters of two strings match. The length of lcs is length of lcs of X[0..i-1] and Y[0..j-1] 2) The last characters don't match. The length of lcs is max of following two lcs values a) LCS of X[0..i-1] and Y[0..j] b) LCS of X[0..i] and Y[0..j-1]
Question 9 |
33 | |
23 | |
43 | |
34 |
Discuss it
Question 10 |
1500 | |
2000 | |
500 | |
100 |
Discuss it

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
