A log algorithm typically is one where you cut the size of the problem down by some multiplicative factor.
对数级复杂度的算法就是指,通过一系列常量级步数的操作,可以将问题的规模。
Linear algorithms tend to be things where, at one pass-through, you reduce the problem by a constant amount by one. If you reduce it by two, 1 it's going to be the same thing.
有问题么?,线性复杂度的算法,当进行了一个,常量级步数的操作的时候,将问题的规模缩小了一个。
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的操作。
应用推荐