The second chapter summarizes the algorithm

1. Experience divide and conquer idea:

The basic idea is to divide and conquer method: a problem of size n decomposed into k smaller sub-problems, these sub-problems independent of each other and the same as the original problem. Solution of these sub-problems recursively

Binary search is the typical example of the use of partition usually often used to optimize each time the size of the search array is reduced by half, then you can find value in logn time.

The scale of the problem and gradually split into small enough parts to get the solution, and then combined to give the overall solution, an idea is really good. Some glance no idea of ​​the subject, can be solved through clever partition, this process is somehow magical feeling.

2. thoughts pair programming:

Cooperation is very pleasant, efficient solution to the problem, although the code is not the same style, but has been promoting the idea of ​​each other.

Guess you like

Origin www.cnblogs.com/-y-i-/p/11671291.html