But let's look for a slight variant of it, where greedy is not so good. And that's what's called the zero-one knapsack problem.
但是让我们找一找它的一些变种,在这些变种中贪婪算法用处不大,这些问题也就是0/1背包问题。
In order to fill their own bellies, so greedy are they, they intruded into the church's fold and devour for themselves -this is how the allegory works -devour for themselves the nourishment that of course they should be sharing with their flock.
为了填满他们的欲望,他们挥霍了教会的资金,这就是讽喻的含义,在自我满足中尽情的挥霍,当然他们需要与自己的信徒共享。
There's no more room. So the greedy thief take that and leaves.
所以这个贪婪的贼就带着这些东西走了,但是这并不是一个最优选择。
Instead of taking that one vase, the thief could take two radios. And get more value. So the greedy thief, in some sense, gets the wrong answer. But maybe isn't so dumb.
这个贼可以带走两个收音机,这样总价值更大,因此这个贪婪的贼,在某种意义上没有得到正确的答案,但是可能它也不笨。
应用推荐