If I'm running a quadratic algorithm, it'll take one millisecond to complete.
算法会在1毫秒内完成,如果问题的复。
We have seen log, linear, quadratic, and exponential.
平方级的和指数级复杂度的方法,再说一遍,可能会有些常量。
You can choose a linear interpolation or quadratic, but you've got to choose it.
你可以选择线性插值或抛物线型插值,但你总要做出选择。
The acceleration gives you an extra stuff, quadratic in time.
加速度对位移有额外贡献,是时间的二次项
Log? Linear? Exponential? Quadratic?
对数?线性?指数?平方?
So you can see, even the quadratic ones can blow up in a hurry.
如你所见,甚至平方级复杂度的方法。
We've seen log, we've seen linear, we've seen quadratic, we've seen exponential.
我们看过了对数级的,线性的,二次平方的,指数级的算法。
A linear number of things, quadratic. Right?
线性次遍历,平方,对么?
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.
我们看过一些平方算法,他们一般进行了多次嵌套循环,或者递归迭代调用,对一个线性操作调用线性次,这样就变成平方次了,以后你们能看到,一些多项式算法。
So it's quadratic, in terms of that sort.
也就是这种算法是平方级别的。
It is certainly possible, for example, that a quadratic algorithm could run faster than a linear algorithm. It depends on what the input is, it depends on, you know, what the particular cases are. So it is not the case that, on every input, a linear algorithm is always going to be better than a quadratic algorithm.
一个二次平方级复杂度的算法,当然也是可能跑的比线性复杂度算法快的,这取决于,你知道的,输入以及特定的案例,因此并不是对于每个输入,线性复杂度就一定会,比二次平方级复杂度的算法的表现要好,只是通常来说是这样的。
应用推荐