What do you get if you follow the greedy algorithm? What's the first thing the thief does?
如果年贪婪算法你会带走什么呢?,这个贼做的第一件事是什么?
We'll start with the greedy thief. Well, the greedy thief follows the greedy algorithm.
我们从贪婪的贼开始,这个贪婪的贼按贪婪算法行动。
So he's packing and unpacking, packing and unpacking, trying all possible combinations of objects that will obey the constraint. And then choosing the winner. Well, this is like an algorithm we've seen before. It's not greedy.
因此它不断装包和清包,尝试了所有满足约束条件的物品组合,最后选择最优者,这很像我们以前看过的一个算法,这不是贪婪算法。
应用推荐