Answers to questions about how to learn data structures and algorithms (2)

Source: Internet
Author: User

Book.

Since recently, many readers have asked me questions about "data structure and algorithm learning". They have raised their own puzzles in the learning process from different perspectives, I also asked some practical questions with outstanding commonalities. Today, I will simply summarize it.

Let's first list some common concerns:

Nebster: Do I have to learn about the data structure of C/C ++?

Yang:

First question:
Teacher, could you tell me how to learn algorithms to be more efficient? When C ++ already has a certain foundation, of course, the relationship with language is not that close, I want to know if I want to be familiar with the classical algorithm after mastering a language?

The second question:
Well, this is an understanding. After all, algorithms are implemented in one language. Is the classic data structure more effective? Or, how can we gradually improve it? Is there any practical method?

Third question:
Teacher, can you analyze them separately? It is improving the language proficiency and knowledge about algorithms and data structures. After all, as you said, is it necessary to master the language knowledge tools and master the latter and use the former skillfully? Thank you.

Jiaxurun

Instructor Zuo Fei:
Hello!
I am a loyal reader of your student base camp and have learned a lot of useful information and knowledge from your fights. I 'd like to ask you a question.
When you mention that the programmer's level is largely reflected in the data structure, algorithms, and mastery, I would like to ask: "How do you think the data structure should be learned, in order to be solid and flexible in application "? I usually learn to go to school for debugging based on some examples in the book, but I always think that the program is running wrong, and the more I debug the program, the more I feel that my level is not as good as that of pure theory. Sometimes it's a bit depressing. We sincerely hope that you will receive guidance on your learning methods and knowledge. Thank you!

Next I will focus on the above issues.

1. Relationship between "language (C, C ++ and others)" and "data structure and algorithm"

First of all, these two things are actually not "Bound", and many of you seem to be confused. They are only two courses in the same discipline. However, there is a mixture between them. For example, when talking about the For Loop in C, the teacher may ask you to use the Bubble Method for sorting. In this case, the Bubble Sorting actually involves algorithm knowledge. When talking about the queue in the data structure, the teacher may also ask you to use C ++ to write a priority queue class, which involves the knowledge of the data structure.
But "is it the same to learn C ++ well ?", This is basically impossible to talk about. You can say that you have never learned data structures, and C ++ have also learned quite well. Some programmers use Java all day ,. net and other applications (such as inventory management systems, banking application systems, and library management systems). The language is used smoothly and has rich experience, he will say that it has not been used to solve complicated problems with data structures for several years. This situation is absolutely possible.
Therefore, there is no inevitable link between Data Structure Knowledge and C ++ learning. You should have studied biology before in middle school. One of the textbooks is about animals, and the other is about plants. When talking about animals, the teacher will tell you that animal cells have no cell walls, while plant cells have. When talking about plants, the teacher may also say: green plants can perform photosynthesis, but animals cannot. This is similar to the previous example. So I want to ask, if I have not studied botany, I will start to learn animal science from single-cell animal crawler. Can I learn it well? There should be no major problems. Do you have to emphasize whether you can learn C ++ well without learning the data structure? This actually doesn't make much sense.

What is the use of the data structure? Can I just stop learning? Back to that example, if you only want to study plants and animals in biology, can you take the test? Of course not. They and standing up are a complete system. Computer Language and data structure are required courses in computer education. In the postgraduate entrance exam, data structure is almost a must for professional courses. This is from a comprehensive knowledge perspective. In addition, a practical application is that the data structure is still very useful in actual work. At least many companies will take the test in the interview. If you do not develop software assembly day after day, But do more advanced R & D projects (compared to compiling a Photoshop program or researching the Linux kernel ), if your data structure knowledge is zero, you basically cannot do these quality jobs. If you have read the book Jon Bentley or the beauty of programming, you should know what I'm talking about and understand that algorithms and data structures are important. Of course, if you think that the structure is not structured, and all algorithms are irrelevant to me, and the data structure and algorithms are unknown, you can use Java to develop a system, I have no opinion either. Well, I didn't mean it-Viewer discretion is advised.

2. How to Learn programming well?

I have already mentioned this in my previous blog post. I will not go into details here, if you are interested, you can read the previous article: "cultivating and improving programming capabilities" (1, 2, 3) and "some suggestions for learning C ++" (1, 2, 3 ).

3. How to learn the data structure well?

Three suggestions are provided:
First, you have to give out the computer language. The general rule is that you have to know at least one computer language before learning the data structure. The courses in colleges and universities are also arranged in this way. Why? Isn't it good to say that animals can be used without learning plants? Here is a little different. The plant and animal classes are both theoretical and all for the purpose of taking the test. You only need to remember to do some things. Programming is not good now. Programming is really a tool, because you may have to eat it in the future. It is definitely not possible to talk on paper. If you are not good at Linguistics, then you can directly learn the data structure. In fact, for the final exam, or even the postgraduate exam, the problem is not big, and Chinese students have a strong test ability, this is not a problem. But what I call "Learning" here is that you can use data structures and algorithm knowledge to program and solve practical problems. For example, at least you can program and solve the eight queens problem without any help. This involves two capabilities. Data Structure and algorithm knowledge must be one and another? Programming! Even if the data structure is learned, how can you solve the problem? On paper? First, you must learn the language well, whether it is C, C ++, or Java, but you must have an excellent one and then play with the data structure. If the language is not enough, you can fix the language again. When will the language pass through the data structure.
Second, read books, read a good book, read a good book carefully, read a good book carefully from start to end. (I have mentioned more about books before, so I won't be a majority here .)
Finally, now that your language has passed, you still have a good book. What then? Of course, it is a programming practice. See some practical problems in the book: for example, the Joseph Ring problem, for example, the partner problem, you can solve it by programming on your own (the premise is that the theory already understands, don't sit in front of the computer and it's dark, then I thought about how to compile the program? That means you haven't understood the book yet .)

These three points are the most basic. For other mental and methodological issues, refer to some of my previous articles.

Viewer discretion is advised !!!

----------------------------------------------------

If you want to communicate with me, welcome to the link http://student.csdn.net/invite.php? U = 113322 & C = a139a65a1494291d and I became friends!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.