The second chapter summarizes the work and learning

Learning divide and conquer feelings of:

First recall using the divide and conquer method and conditions: The basic idea is to divide and conquer the problem of a size N decomposed into K smaller sub-problems, these sub-problems to be independent of each other and the same as the original problem.

Divide and conquer although there are conditions, but it has to solve complex problems of the effect is immediate. In the process of learning the second chapter, we encountered a lot of complex requirements of the subject, such as sorting, such as the number of reverse seeking, although the subject of the request is complicated, but by using divide and conquer, we were able to break the problem into many of the same small problem, for example by providing the left, right to search for the array, and the changing value of the left and right according to the conditions. After using this idea, and then use the recursive method, you can effectively solve the problem of searching for specific values ​​in the array. However, the divide and conquer despite the good results, but will be bound by the conditions of use, while in the course of time to analyze the specific complexity, can not be used indiscriminately.

 

Debriefing pair programming:

Chapter II operations have five questions, each question is challenging, and therefore solely on my personal ability to solve five difficult questions, so I repeatedly and partner to discuss topics, the ultimate solution to the second chapter jobs most topics. Particularly with regard to the subject seeking a single peak array, when I do tend to use the recursive method, but even thinking compile correctly, there is no problem, but because there is no time taking into account the complexity of the problem, resulting in the title did not do right. Through the exchange and programming partner, I know This question is used to cycle, because the topics required time complexity is O (logN), so use the dichotomy of mating cycles can effectively solve the question head. Sometimes, single programming is limited to personal programming style and habits, it is difficult to find some problems on ideological and details of the individual, but the pair programming, two of brainstorming and thinking collision can be a good solution to the problem by two, At the same time the exchange of problem-solving and learning experience.

Guess you like

Origin www.cnblogs.com/besthunterhj/p/11646471.html