在那里做一次分解,做到这步时,我们可以把这些进行合并,然后把这个拿下来,做分解合并过程后再把它们拿回去。
At that stage we can merge these, and then take this down, do the division merge and bring them back up.
关注点分离建议将业务需求分解为多个服务;合并表示业务流程的现有服务以及新的服务的组合。
Separation of concerns suggests decomposing business needs into services; and composing combinations of existing and new services that represent business processes.
我不断的进行子分解,直到得到简单的问题,然后我再把它们合并回去。
I just kept sub-dividing down until I got really easy problems, and then I combine them back.
At that stage we can merge these, and then take this down, do the division merge and bring them back up.
在那里做一次分解,做到这步时,我们可以把这些进行合并,然后把这个拿下来,做分解合并过程后再把它们拿回去。
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.
因为适合用分治算法解决的问题,最好是能够简单的将问题进行分解,并且合并的过程不是非常的复杂,只要比线性方案要小。
Notice here that it's different than the binary search case. We're certainly dividing down, but the combination now actually takes some work. I'll have to actually figure out how to put them back together. And that's a general thing you want to keep in mind when you're thinking about designing a divide and conquer kind of algorithm.
一个分治的例子,注这里,与二分查找所不同的地方,我们肯定是分解了,但是合并的过程还是需要一些工作量的,我会详细说明怎样把它们合并在一起的,当你在考虑设计一个分治算法时,这是你要必须记住的最基本的东西。
应用推荐