The solution is so simple, give us $2, we'll give you a ticket and yet it takes nine steps to do that.
解决方案也简单,给我们2美元,我们将给你一张票,但是你需要9个步骤来处理。
The other obvious one to do would be worst case. Again, over all possible inputs to this function, what's the most number of steps it takes to do the computation?
很明显另一种就是针对最坏的情况了,也就是在所有可能的输入,里面选出用的,步骤最多的那个输入?
So the running time I claim to sort 16 elements takes 64 steps.
可见对16个元素排序需要进行64步。
And the Bacon number is the number of steps it takes for them to get to Kevin Bacon.
这个Bacon数就是通过几度,他们就能与Kavin,Bacon连接上。
We're going to be counting the number of basic steps it takes to solve the problem.
我们还要去数着,解决问题的的基本步骤有多少。
So I take 2 plus 3 b steps to go through this loop OK. So if b is 300, it takes 902 steps.
好,如果b是300的话就是902步,如果b是3000那就有9002步。
As I said, what we want to do is, we want to count the number of basic steps it takes to compute a computation as a function of input size.
我刚才提到了,我们要建立,一个根据输入大小的方法来计算,一个计算过程需要的时间,建立这个方法需要几步呢?
I'm going to let t of b be the number of steps it takes to solve the problem of size b.
我会设立一个t作为,计算指数为b的时候解决问题需要的步骤数。
I've got one test, I've got a subtraction, I've got a multiplication, that's three steps, plus whatever number of steps it takes to solve a problem of size b minus 1.
我进行了一次比较,一次减法,一次乘法,一共是三个步骤,再加上t的步骤数。
应用推荐