Reviewed and restart

Two years, LeetCode brush 600 + at the same time, I also understand that training a lot of classic data structures and algorithms problems. In the process of the brush in question, a deeper understanding of data structures and algorithms, for Python language to do more practice. I believe that the question is not just to brush looking for work, but also in more upgrade themselves. Here, the summary record their questions and insights brush.
I believe that the question of the process of brush has three phases:
1, imitation and memory. The first process is the most difficult but also the most basic. For nothing algorithm based on the students, came into contact with a KMP algorithm, horse-drawn carriage algorithm is difficult to be able to do will see it again, do it again the degree will be able to dictation. This is an iterative process, only brush a few times relevant questions in order to understand, and understand that the use of this type of data or the use of techniques and advantages of this algorithm. This phase should be done: done to a question, can quickly recall specific process and the nature of the algorithm and algorithm of its use.
2, analysis and summary. This phase, that of my culture, "the title a sense of" process, which is the process of learning to brush the question of routine. In the process summarized in order to truly understand why this problem to use this type of data, why can reduce the time complexity, next time what kinds of questions can also use this technique to solve problems. This phase should be done: to a class of questions, the kinds of questions can quickly recall commonly used techniques and algorithms, and can include twelve of the most classic example. My previous article also mostly such summary.

For example, an array such as requiring the longest / shortest continuous subarray reaches a certain condition, the start / end of each element to consider the time, longest / shortest continuous subarray.

3, thinking and generalization. When did a certain amount of questions you have for commonly used data structures, algorithms gains a new title for a familiar, I think you can quickly think of commonly used algorithms solution, and can quickly tell his optimal time complexity of data structures used. But for an unfamiliar title, abandon the so-called right algorithms and data structures, many times, ways of thinking than a fixed routine, and more useful. In particular, when written, there is little question that you are familiar with the routine questions, this time to stop and to think, the best solution is usually by deduction, generalization get, not what you think the most cattle a data structure (segments tree, disjoint-set and the like) can be solved.

Typically, matryoshka problem. Of course, on the one hand, you have to understand classical solution longest increasing sequence, on the other hand need to think about how to reduce the time complexity of the solution, here it is sort of why the sorting solution to optimize it?

In addition, my advice is to brush the question, first brush twice wins the offer, then brush LeetCode ago 100 according to the classification, then the order of 101 from the start of training or random.
A time when the end of autumn strokes, brush my title record also reached a new stage. Autumn recruited by Microsoft's interview, I think is definitely my data structures and basic algorithms. The next plan is to restart LeetCode brush summary of 600 + questions, and prepare the way cpp implemented in Python +, hope to continue to improve it.
And you encourage each other.

Guess you like

Origin www.cnblogs.com/hellojamest/p/11803244.html