answersLogoWhite

0

seen then.

Consider this example.

You are standing at a place p. You are to goto q. 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 goto the nearest intermediate place. Why? You feel by going to the nearest intermediate place, you will minimize the distance to q.

Dynamic Programming

You try all the places, but you store the previous result. Eg: To reach C3 in minimum distance, you reached by C1. So you store C1. So if you want to go to C5, by C3, you will goto C1 then C3 and then check if going from C3 to C5 is nearest.

I would suggest you read Intro to Algorithms by CLRS to understand in greater detail.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin

Add your answer:

Earn +20 pts
Q: Difference between greedy method and dynamic programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp