What is the difference between dynamic programming and greedy approach?

前端 未结 6 2386
忘掉有多难
忘掉有多难 2020-12-12 10:10

What is the main difference between dynamic programming and greedy approach in terms of usage?

As far as I understood, the greedy approach sometimes gives a

6条回答
  •  心在旅途
    2020-12-12 10:58

    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.

提交回复
热议问题