Consider the following statements :
(a) The running time of dynamic programming θ(ρ) ρ algorithm is alway where is number of subproblems.
(b) When a recurrence relation has cyclic dependency, it is impossible to use that recurrence relation (unmodified) in a correct dynamic program.
(c) For a dynamic programming algorithm, computing all values in a bottom-up fashion is asymptotically faster than using recursion and memorization. X
(d) If a problem can be reduced to a known X NP-hard problem, then must be NP-hard. Which of the statement(s) is (are) true?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. Only (b)
Explanation
Only (b) is true: a recurrence with cyclic dependencies cannot be evaluated directly by DP. Running time also depends on work per subproblem (a false); bottom-up and memoized versions have the same asymptotics (c false); reducing X to an NP-hard problem says nothing about X's hardness (d false).
More Data Structures and Algorithms questions
- With preconditions p ≥ 1 and n ≥ 0 (no overflow): int x = p; int k = n; int m = 1; while (k != 0) { if (k is odd) m = m * x; x = x * x; k =…
- Match List I with List II. List I: (a) Prim's algorithm, (b) Dijkstra's algorithm, (c) Faster all-pairs shortest path, (d) Edmonds-Karp alg…
- There are many sorting algorithms based on comparison. The running time of heapsort O(n lg n) P Q algorithm is . Like , but unlike , (P, Q)…
- Which of the following is best running time to n n2 − 1 sort integers in the range 0 to ?
- Which of the following is application of depth- first search?
- Consider double hashing of the form h(k, i) = (h (k) + ih (k)) mod m 1 2 h (k) = k mod m where 1 h (k) = 1 + (k mod n) 2 n = m − 1 m = 701…