If I'm running a quadratic algorithm, it'll take one millisecond to complete.
算法会在1毫秒内完成,如果问题的复。
If I'm running a linear algorithm, it'll take one microsecond to complete.
算法会在1微秒内完成,如果是一个平方级的方法。
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,次。
应用推荐