So in other words, every time I merge the point that I kept emphasizing verbally there and that I'm only touching each number once, means that we have to account for the amount of time it takes to merge N which is going to be just N. Now, this is again one of these cyclical answers.
换言之,之前在做合并时,我不停地强调,对每个数字我只碰了一次,这就是说,我们要记录合并所花的时间量,也就是这里的,这又是一种循环性的答案。
That's why in the earlier models of the atom, they're not horrible to sometimes think about just each n value as a little ring around.
这就是为什么在早期原子模型中,人们没有感觉到把每一个,n,都想象成,一个绕核的小圆圈有什么不妥。
We said each of the merge operations O was of order n. But n is different. Right?
注意这里发生了什么,我们说过每一次合并操作的复杂度都是?
.. I started out with the equally-weighted-- I was talking about stocks-- about n stocks that all have the same variance and are all independent of each other.
开始的时候我讲了等权重的-,我开始时讲了股票-,几支拥有相同方差的股票,彼此间相互独立。
Such where the deep transported mind may soar Above the wheeling poles, and at Heav'n's door Look in, and see each blissful Deity Now the graver subject that Milton is intending at some point to expound upon is clearly an epic one.
埋藏于心底的思想会,冲天而上并到达上帝的门前,往里一瞥你会看到每个快乐的神,现在弥尔顿正打算用更庄重的主题,详细点说就是史诗。
So if on each iteration of merging I'm doing eight things or more generally, N. That then begs the question, how many levels of this tree are there actually?
可见对于合并我需要迭代8次,一般情况下是N,这取决于具体问题,那么在这棵树中一共有多少层呢?
If you start with only one, you have two pieces of DNA, then you'll get 2 to the Nth fragments after N cycles because each cycle you're doubling the number.
如果你从仅仅一个DNA开始,你有两条DNA链,经过N次循环后,就得到二的N次方个DNA片段,因为每次循环都使其数量翻倍
Ah, n times, because for each value of i, I'm going to do that m thing, n*m so that is, close to what you said, right?
因此这就和你说的差不多了对不对?,这个问题的复杂度为,让我写下来,是-对不对,是?
Log n Log n, because at each stage I'm cutting the problem in half. So I start off with n then it's n n/2 n/4 n/8 over two n over four n over eight.
因为总共有多少层?,因为在每一层,我都是把问题分解成两半,因此以n开始,然后是。
O Right there, order n. So I have order n operations at each level in the tree. And then how many levels deep am I? Well, that's the divide, right? So how many levels do I have?
在这儿,所以我在树的每个层次都要做O的操作,那个这棵有多少层呢?,这是一个除法,不是吗?
And in this case, we go from 8 to 4 to 2 to 1 three times and then on each iteration of this algorithm, each pass across the board I'm touching N numbers, so that means I'm doing N things, log N times.
在这个例子中,我们从8得到4,到2,再到1,是3次,在这个算法的每次迭代中,每一趟我都会操作N个数,也就是所我每次要做N步操作,一共要做,log,N,次。
应用推荐