Consider the following statements:
I – In dynamic programming, the output to stage n become the input to stage n+1
II – Bellman-Ford, 0-1 knapsack, Floyd Warshall algorithm are the dynamic programming based algorithm.
III – Dynamic programming is faster than a greedy problem.
IV – We use a dynamic programming approach when we need an optimal solution.
Which of the following statements is/are correct.

(A) I and III
(B) II and III
(C) II only
(D) III and IV


Answer: (C)

Explanation: I – In dynamic programming, the output to stage n become the input to stage n-1.
II – Bellman-Ford, 0-1 knapsack, Floyd Warshall algorithm are the dynamic programming based algorithm.
III – Greedy algorithms are generally faster than Dynamic programming.
IV – We use a dynamic programming approach when solution has optimal structure.

So, option (C) is correct.


Quiz of this Question


  • Last Updated : 20 Nov, 2018

Share your thoughts in the comments