Greedy Method | Dynamic Programming |
---|---|
The main Difference is,greedy algorithm makes one greedy choice after another.. thereby reducing the problem into smaller sub-problem at each step. In other word,it never reconsider it choices. | While on the other hand, Dynamic programming at each step, makes decision based on all the decisions made on so far till the previous stage. If necessary, it may reconsider the solution of previous sub-problems as well. |
Greedy algorithms are comparatively easier to implement but not guaranteed to lead to an optimal solution at the end as it is based upon local optimizations done at each step. | Dynamic programming can be relatively slower than Greedy because it takes into account the solution of all sub-problems solved so far but it is guaranteed to provide optimal solution at the end. |
A greedy algorithm is one which finds optimal solution at and every stage with the hope of finding global optimum at the end. | On the other hand ... A Dynamic algorithm is applicable to problems that exhibit overlapping sub-problems and optimal sub-structure properties. |
Greedy method more efficient as compared to Dynamic programming. | Dynamic programming less efficient as compared to Greedy approach. |
A corner of Computer Science & Engineering related things
Home
4th Semester
Algorithm Design Computer Architecture Database Management System Data Communications Economics5th Semester
Theory of Computation Microprocessor and Assembly Language Engineering Mathematics Sociology Technical Writing and Communications
.