Boy, there's a dumb question, because I've been telling you n log n for the last two lectures the complexity is n log n, but let's see if it really is.
孩子们,这是一个愚蠢的问题,因为前两节课的时候我就已经告诉你们了,复杂度是,但是让我们来看一下是不是真的是这样。
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,这取决于具体问题,那么在这棵树中一共有多少层呢?
So, it would be a good question to ask n why are we limited clearly there's this relationship between l and n, and we can't get any higher than n equals one.
那我们要问了,为什么我们被限制了,很明显,l和,有关系,为什么不能取到,n-1更大的值。
应用推荐