It at least does corroborate the claim that merge sort N*log N as we argue intuitively is in fact, N log N in running time.
但这至少证实了归并排序,的时间复杂度为。
Let's suppose n is 1000, and we're running at nanosecond speed.
假入我们一秒钟运算十亿次,我们已经看过了对数级,线性增长的。
So the running time of the problem where the input is T of size N as expressed here formulaically, T of N, the running time of an algorithm, given an input of size N. You know what?
因此一个输入为N的问题的运行时间,在这儿的公式表示为,如果输入为N,那么此算法的运行时间,是多少呢?
If I'm running at nanosecond speed, 1000 n, the size of the problem, whatever it is, is 1000, and I've got a log algorithm, it takes 10 nanoseconds to complete.
如果这个问题的规模,也就是n,是,如果这个问题是对数级的,这将会占据10纳秒的时间,你一眨眼的时间。
If I'm using algorithm that I'm now calling merge sort, T the running time involved in sorting N elements, T of N, you know, is just the same as running the algorithm for the right half, plus what's this plus N come from?
如果我用归并排序算法,对N个元素其运行时间,就等于此算法一半元素的运行时间,另一半的运行时间,再加上N,这个N是什么呢?
应用推荐