The experts at N.I.H.say you may have to repeat this process a few times.
VOA: special.2010.03.31
So I have n operations log n times, n log n there we go, n log n. Took us a long time to get there, but it's a nice algorithm to have.
所以我log,n遍的n次操作,就得到了,虽然花了不少时间得到了这个结论。
Down here, I've just got two things to merge, and then I've got things of size two to merge and then things of size four to merge. But notice a trade off. I have n operations if you like down there of size one.
但是n的大小是不同的,是吗?在这里我们只要合并两个元素,然后是合并长度为2的列表,接下来是合并长度为4的列表,但是观察一下之间的权衡关系。
So, what we're saying is that we have n equals to 4, and m sub I being equal to negative 2.
我们说的是n等于4,ml等于-2
And this is now consistent with my claim that I have sorted a list of size N equals 1.
这与我之前所说的是一致的,我已经将N为1的一个序列排好了序。
.. 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.
开始的时候我讲了等权重的-,我开始时讲了股票-,几支拥有相同方差的股票,彼此间相互独立。
Up here I have n over two operations of size two. Up here I've got n over four operations of size four.
最下面有n个规模为1的操作,接着上面有n/2个规模为2的操作,再上面有n/4个规模为4的操作。
If you have a sample with n observations, it's the summation I = 1 to n of xi/n--that's the average.
如果你有n个观测值,对Xi从i=1到n求和再除以n
So if N is not less than 2, that is I have two elements or more in which case there's definitely some sorting to be done.
因此如果N不小于2,也就是有2个或更多的元素,那当然是需要做排序的。
When we have n observations it's just the summation i = 1 to n of 2/n.
当有n个观察值,这就是在i取1到n时,x减去x均值的平方,除以n的累加
So I always have to do a merge of n elements.
所以我始终需要做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的操作,那个这棵有多少层呢?,这是一个除法,不是吗?
So as I tried to say on the board, we can have n equals 1, 1/2 but since we can't have n equals 1/2, we actually can't have a binding energy that's anywhere in between these levels that are indicated here. And that's a really important point for something that comes out of solving the Schrodinger equation is this quantization of energy levels.
我在这要说的是,我们可以让n等于,但不能让n等于,我们不能得到在这些标出来的,能级之间的结合能,能级的量子化,是从解薛定谔方程中,得到的很重要的一点。
Given the code up there, if I want to move a tower of size n, what do I have to do?
鉴于这里的代码,如果我想移动N个圆盘,我该怎么做?
> >> David: Yeah, so I didn't have my "backslash n."
>,【无法辨认的声音】,>>,大卫:是的,我没有加入“反斜杠,n“
And now I have a problem of size N minus 1.
现在是一个N-1大小的问题。
Once I have it sorted I can search it in log n time, but that's still isn't as good as just doing n. And this led to this idea of amortization, which is I need to not only factor in the cost, but how am I going to use it?
一旦对其完成排序,就可以在log,n的时间内对其完成搜索,但是这样做仍然不如n的复杂度,这样做引出了耗时分摊的想法,这时不仅需要考虑耗时的因素?
I now have a list of size 1 so N is, in fact, less than 2.
现在序列的大小是1,可见N小于。
应用推荐