再问个coin change的问题# JobHunting - 待字闺中
l*d
1 楼
如果面额组合满足下面条件,是不是就可以用greedy algorithm找最优解?
for each denomination, the denomination just smaller than it was a perfect
divisor of it. (i.e. 25 was a factor of 125; 5 was a factor of 25; 1 was a
factor of 5}.
http://tkramesh.wordpress.com/2011/03/09/greedy-algorithms-coin
面试时要是碰到这个组合,直接跟面试官说it is proven that... so I will use
greedy algorithm instead of DP here,行不
for each denomination, the denomination just smaller than it was a perfect
divisor of it. (i.e. 25 was a factor of 125; 5 was a factor of 25; 1 was a
factor of 5}.
http://tkramesh.wordpress.com/2011/03/09/greedy-algorithms-coin
面试时要是碰到这个组合,直接跟面试官说it is proven that... so I will use
greedy algorithm instead of DP here,行不