I prejudge people on the greedy approach in favor of the DP approach because it can solve optimization problems. Do you think that one of them is better? To argue with my friends I need to gather arguments in favor of better technology. OK, DP is used to solve problems in which the optimal infrastructure and optimum principle apply to them. But should the DP be better than the grasping approach?
Your question is what you are trying to solve.
Dynamic programming is a tool that is useful for solving a certain category of the problem.
Greedy algorithms are another device. They are useful in other circumstances.
It is like asking "which one is better - a hammer or a saw"?
Answer Trying to be different depending on what you are.
Comments
Post a Comment