What's the complexity of this decision tree solution? Well, in the worst case, we're enumerating every possibility of in and out.
决策树解决方法的复杂度是多少?,在最糟的例子中得列举,所有可能的输入和输出。
And we're going to do this initially by looking at a straightforward implementation based upon what's called the decision tree.
我们将要做的是看看一种,直截了当的执行方案,这种方案是基于决策树的。
And then I'm going to just return the bigger of the two. Little bit complicated, but it's basically just implementing this decision tree.
我会计算总价值,然后我会返回两者中的较大值,有点小复杂,但是它就是按照这个决策树在运行。
Now, the decision tree, if I branch left, it's a binary tree.
现在,这个决策树,如果我走左边的分支,这是一棵二叉树。
应用推荐