differences between dynamic, divide-and-conquer, and greedy programming

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.

Greedy: 

Strategy: A solution is made up of a number of steps. At each step do what is best for you at that time. (Note: It may or may not be the best choice going forward into the game... Like a local maxima)

Example: When you are playing Cricket. At each ball you would want to Hit a six to maximise your score! 

 Dynamic Programming : 

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值