Describe in what extent dynamic programming performs better than greedy approach.

Please - Describe in what extent dynamic programming performs better than greedy approach.

@rashedcs Greedy approach does not give optimal solution always. For a clear explanation, you can refer to this answer(link).

1 Like

In simple words we can say that in Dynamic Programming (having problem sending message on network) one can first examine the path which takes the shortest time and then start journey,

On the other hand Greedy algorithm take the optimal decision on the spot without thinking for the next step and on the next step change its decision again and so on…

Notes: Dynamic programming is reliable while Greedy Algorithms is not reliable always.

Here’s a presentation.
[PPT] http://www.cs.binghamton.edu/~dima/cs333/knapsack.ppt

1 Like