How to effectively learn algorithms
The basic idea of learning algorithm is: first learn algorithm ideas, then digest ideas by doing problems, and slowly learn in the process of doing problems, master some small skills . Among them, the algorithm idea is , and the classic problem and problem- technique is 16158820d59d1c technique . The problem is to perfect the Tao through skills.
However, many people have responded that between reading the lecture notes and doing the questions 16158820d59d54. What to do about this?
<!-- more -->
In addition to writing more and practicing more, I think the following two points can help you:
- Combine with handouts (learning materials) when doing the questions
This is a very important and easily overlooked point. Take "91 Tianxue Algorithm" as an example: reading the lecture notes is to learn thoughts, and one question every day is to consolidate and digest thoughts. When doing a daily question, you should rely more on the handout. For example, think about which part of the handout corresponds to this question, and examine which knowledge point mentioned in the handout.
- When looking at the handouts (study materials), run the examples visually by yourself
When I first started learning algorithms, it was basically this way of thinking. When you finish studying the thought and doing the problem, draw the code execution process on the computer or paper for the sample questions, and then combine it with the learned algorithm idea. In this way, not only the algorithm ideas are easy to absorb, but also the embarrassing situation of will be abolished as soon as you write it.
But after all, drawing pictures by yourself is a bit costly, and not all people have the motivation to draw pictures on their own. Programmers are very lazy. In fact, when I first started writing questions, I always had an idea. How good would it be if the questions were visually displayed? It's best to be similar to the one in my handout, so it will undoubtedly be more efficient for novices to absorb ideas.
Visual debugging plug-in
It's not a coincidence that a book is not written. A few days ago, someone in the "91 Tianxue Algorithm" group mentioned LeetCode for debugging. Some of you use IDE to debug, and some use member's debugging function to debug on the web. In fact, a while ago, I shared the debugging plug-in when I shared the skills of who have not read it can see what is the correct posture of 16158820d59f6a? .
Today I will share a debugging tool suitable for novices, which is easy to use, intuitive and convenient. More importantly, has been built into my leetcode-cheatsheet plug-in, can be used directly out of the box, and the plug-in version is greater than or equal to 0.9.0. Although it is not yet able to automatically generate as complete pictures and animations as in my lecture notes, it is much more intuitive than text. Later, consider integrating more languages and more grammatical features and better display effects.
The use method is very simple and fully meets everyone's need for laziness. You only need:
- Install the leetcode-cheatsheet plugin
How to download and install the plug-in can be obtained by replying to the plug-in on the official account
- Open any question in leetcode and write the code.
Currently supports Python3, CPP, JavaScript
- below to visualize debugging
- Follow the prompts to modify the code and click the Visualize Execution button
If you cannot modify the code, you can click edit code first
Here I want to complain about leetcode. Why are the function names different for each question? It's really unnecessary. For example, are they called solve bad? I hope Likou can consider this suggestion.
- Through the control area control code execution, the right side will automatically synchronize and visually display the variable information
Finally, a friendly reminder. Visual debugging is recommended to debug the examples in a visual way when looking at the materials (such as the handout of 91 the gap between the 16158820d5a566 idea and the code 16158820d5a569. After that, you should not rely on the debugging function to do the problem, but first debug the , and then use the tool to verify. In other words, this tool, I only recommend you to use it in two situations:
- Look at the algorithm thought materials, and debug and learn step by step when doing the examples.
- There are cases where the code does not work. First go through it in your mind to guess the likely problem, and then use the tool to locate it directly nearby and help you analyze it visually.
Finally, if you have any features you want, you can leave a message in the backstage of the official account or in the exchange group.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。