Wednesday, February 3, 2016

[Algo] Greedy 贪心算法

Greedy  贪心算法
[https://en.wikipedia.org/wiki/Greedy_algorithm]

Principle : locally optimal choice for every stage, but this algo need the situation : the step after will not change the result  (无后效性)

HOW :
1 divide the problem to small sub problems
2 make solve every sub problem with local optimal
3 combine every sub local optimal solution for the problem

Application :

背包问题
Knap sack problem

No comments:

Post a Comment