menu search
brightness_auto
more_vert
Write the difference between greedy method and dynamic programming
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
Greedy method Dynamic programming
Does not guarantee an optimal solution Guarantees an optimal solution
Assumes sub-problems do not overlap Assumes sub-problems overlap
Does little work Does more work
Only considers current choices Considers future choices
Constructs the solution from a set of feasible choices There is no specialized set of feasible choices
Selects a locally optimum choice Selects globally optimum choices
No concept of memorization Employs memorization
Examples: Knapsack, Job scheduling with deadlines, Kruskal, Prim’s Examples: All pair shortest path, 0/1 Knapsack, Travelling salesman problem, LCS
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

648 users

...