And it's called divide and conquer for the obvious reason. I'm going to divide it up into sub-problems with the hope that those sub-problems get easier. It's going to be easier to conquer if you like, and then I'm going to merge them back. Now, in the binary search case, in some sense, this is a little bit trivial.
因此被称为分治的原因就这么简单,将一个问题分解成一些子问题,并希望这些子问题解决起来比较方便,正如你希望的,求解的过程也会变得简单,下面就是把结果合并起来,现在,在二分搜索的例子里,从某些方面来说,这有点微不足道。
So things that are good candidates for divide And conquer are problems where it's easy to figure out how to divide down, and the combination is of little complexity.
因为适合用分治算法解决的问题,最好是能够简单的将问题进行分解,并且合并的过程不是非常的复杂,只要比线性方案要小。
One by one he subdued his father's trees By riding them down over and over again Until he took the stiffness out of them - And not one but hung limp, not one was left for him to conquer.
他一株一株地征服他父亲的树,一次又一次地把它们骑在胯下,直到把树的倔强劲儿完全制服:,一株又一株都垂头丧气地低下来。
应用推荐