Computer Science, asked by pragsshetty9691, 11 months ago

Difference between greedy method and divide and conquer and dynamic

Answers

Answered by BushrajavediqbalKhan
0

Difference between greedy method and divide and conquer and dynamic

Explanation:

Greedy Method:

A Greedy algorithm is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also leads to a global solution are best fit for Greedy.

Divide and Conquer:

Strategy: Break a small problem into smaller sub-problems. Smaller sub-problems will most likely be a scaled down version of the original problem. Solve the smaller problems. Combine the smaller solutions to make the complete solution!

Example: When you want to eat a big fat chocolate. You break it into smaller pieces. And have it one at a time.

Dynamic :

Strategy: You can't just choose a local maxima always. So you would need an exhaustive search of the solution space. Instead of recomputing each step multiple times. You would calculate smaller solutions, save them in a table and look them up when recall is computationally cheaper than re-computation.

Example: Chess!.. You can't just choose the best current move. You need to think of future possibilities and scenarios.

Similar questions