Algorithms | Dynamic Programming | Question 2

We use dynamic programming approach when
(A) It provides optimal solution
(B) The solution has optimal substructure
(C) The given problem can be reduced to the 3-SAT problem
(D) It’s faster than Greedy


Answer: (B)

Explanation: https://www.geeksforgeeks.org/dynamic-programming-set-2-optimal-substructure-property/

Option (D) is incorrect because Greedy algorithms are generally faster than Dynamic programming. See https://www.geeksforgeeks.org/greedy-algorithms-set-1-activity-selection-problem/




Recommended Posts:



3 Average Difficulty : 3/5.0
Based on 1 vote(s)