I've got to do another pass. Huh. Sounds like a linear number of times I've got to do- oh fudge knuckle.
冒到最后去,还得再做冒泡,呵,听起来我要做线性次的时间-,哦,胡说八道。
We saw some quadratic algorithms, typically those are things with multiple nested loops, or iterative or recursive calls, where you're doing, say, a linear amount of time but you're doing it a linear number of times and so it becomes quadratic, and you'll see other polynomial kinds of algorithms.
我们看过一些平方算法,他们一般进行了多次嵌套循环,或者递归迭代调用,对一个线性操作调用线性次,这样就变成平方次了,以后你们能看到,一些多项式算法。
And this is what they had expected that there would be no relationship, but instead here they saw that there was a linear relationship not to the intensity and the kinetic energy of the electrons, but to the intensity and the number of electrons.
另外一个实验,他们预期这两者没有关系,但他们看到的不是,光强和电子动能的,线性关系,而是光强,和电子数的线性关系。
We know that the Mycenaeans, or at least some small number of them could write, because we have the Linear B script, which we can read. There is no clue that there is such a thing as writing in the Homeric poems.
我们知道迈锡尼人中,至少小部分,是会写作的,因为我们找到了B类线形文字的遗稿,我们能够解读,但在荷马史诗中,却并没有任何线索表明写作这一点
A linear number of things, quadratic. Right?
线性次遍历,平方,对么?
That one's not so obvious. So let's think about this for a second. To sort a list in linear time, would say, I have to look at each element in the list at most a constant number of times.
所以让我们来思考一会,要在线性时间能排序,列表里每个元素最多被使用常数次,不一定是一次,对吧。
System of linear equations. What are the equations here? Well, I could say, you know, the number of pigs plus the number of 20 chickens equals 20, right? Because we've got 20 heads. And then what else do I have?
如何解决这个问题呢?,用线性方程式的办法来解决,等式是什么呢?你应该知道,猪的数量加鸡的数量等于,对吧?因为我们有20个头?
Now this happens to be what we would call a linear process, because the number of times I go around the loop is directly related to the size of the argument. If I double 2 the argument, I'm going to double the number of times I go around the loop. If I increase it by five, 5 I'm going to increase by five the number of times I go around the loop.
这恰好是我们会成为,线性复杂度程序的一个例子,因为我要执行循环的次数是,和输入的参数的大小直接相关的,如果我将这个参数乘以,那么我就要将进行循环的次数也乘以2了,如果我把参数加上,那么循环的次数也要加上5了。
应用推荐