Dynamic Programming is always preferable over greedy approach " Support or contradict this statement with solid arguments.
A concise, coherent and to the point comment is preferred over lengthy comment having irrelevant details. Your comment must not be more than 5-7 lines. Comments, posted on regular Lesson's MDB or sent through email will NOT be considered. Any request about such an acceptance will not be catered.
launched on July 9, 2012 and it will remain open till July 10, 2012.
A greedy algorithm is similar to a dynamic programming algorithm, but the difference is that solutions to the subproblems do not have to be known at each stage; instead a "greedy" choice can be made of what looks best for the moment.
Consider this example.
You are standing at a place A. You are to goto B. There are intermediate places C1,C2 ...
You want to minimize distance travelled.
Greedy Method of Solving
You don’t want to try all intermediate places. You go to the nearest intermediate place. Why? You feel by going to the nearest intermediate place, you will minimize the distance to B.
Syed M. Umair Saulat gud.keep it up & keep sharing
tariq bhai cs501 mai bi khuch help kro gdb mai plzzzzzzzzzzzzzzzz