Rather than create subclasses for all the combinations of possible roles, a class is created for each individual role.
它不是为所有的可能角色组合创建子类,而是为每个单独的角色创建一个类。
Let's test it in all possible combinations of x and y and see if we get the right answer.
来测试并看看,返回的结果正确不正确。
So, let's think of all of the combinations that we could have in terms of this molecule.
那么,让我们想一想这个分子,所有可能的组合方式。
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.
因此它不断装包和清包,尝试了所有满足约束条件的物品组合,最后选择最优者,这很像我们以前看过的一个算法,这不是贪婪算法。
应用推荐