Novice algorithm learning experience (c++)

I haven’t blogged for a long time. The main reason is that I am busy with classes or studying. I am definitely not playful. I have simply learned some algorithms recently, so I would like to briefly summarize my learning experience.

Preface

In the first semester of my freshman year, my senior began to teach us some algorithms, dp, greedy, etc., but for a long time I didn’t understand why we should write like this. I was also confused by recursion for a long time, so I wrote This simple self-learning experience is here to help those who are destined to learn algorithms, so that novices will not be afraid of and avoid algorithms. Because I have just finished learning algorithms, I look at the problem more like a novice, so it is also suitable for you as a novice.

learning experience

What I write here is my learning experience. I only write down the most important causes and consequences. I will not write down the detours in the process here. In the first semester of freshman year, the mother tongue is C

  1. I started learning data structures some time after I finished learning C in my freshman year, and I went through part of Luogu’s Novice Village and learned the simple usage of C++.
  2. During the first semester of my freshman year, I started to learn some STL usage and data structures of C++. The depth I learned was just a simple impression in my mind.
  3. In the second semester of my freshman year, I started to follow the school system to learn data structure, and left a deep impression on me (it has a lot to do with the previous preview)
  4. During the holidays in the second semester of my freshman year, I started to study questions and algorithms.

This is a simple process, but I personally feel that if there is a problem in any part of it, it will have a great impact on the subsequent understanding of the algorithm.

Prerequisite process of learning algorithm

  • BeforePreviewdata structure, I listened to Zhejiang University’s data structure course, but my understanding ability is limited, most of them just have an impression
  • stl learning is a video made by a big guy at station bsteve-yu, and one he wrote himselfStl simple usage summary
  • For in-depth learning of data structures,must pay attention to hands-on practice. If you don’t do it, you will definitely feel extremely unfamiliar and it is very difficult to learn. Not good

The painful process of learning algorithms

I was like a headless fly at the beginning, so I just studied hard, one LeetCode question every day, but in the end I didn’t know how far I had learned it. I just wrote for half a month, but I felt the same as before, so I started looking for learning methods, and found It took me a long time to finally find a systematic learning method, so I started coding like crazy. Now I am probably at the level of LeetCode 100 questions. During this period, I would often be autistic, and I would laugh out loud when I had an epiphany. Anyway, I felt like the college entrance examination, and I burst into tears.

The specific process of learning algorithms

I learned the learning method of labuladong step by step. Zhihu, leetc, WeChat public accounts, etc. are all about this, and alsoIf you encounter something unfamiliar and difficult to understand, you must Go watch the video, words are always a limited way of expression, don’t stick to words.

recursion

The study of recursion has been with me throughout the semester of my freshman year. It is really a method that people love and hate. I will write about my understanding of recursion later, so I won’t put it here. I’ll pass it on in a while. I will write it again according to my own understanding when the time comes, and put it in this blog. This is the most inspiring articlefor me to learn about recursion

Most algorithms

Most of them learned according to labuladong's method, and his gitbook is placedhere

Egg falling problem

This is a standard question that I still don’t understand after studying for a very long time. I just barely understood it after watching a video on station B.

kmp algorithm

I also read this on site b. It was very difficult to understand, but it suddenly became clear to me after the explanation of the lantern god (who lights lanterns in the first month), so I realized that if you really don’t understand a question, you must watch the video.

Summarize

In fact, this article does not have a lot of gold content. It just briefly writes about my preparation before learning algorithms and a specific method of current learning. However, this alone should be able to help some people. I will share what I have learned in the future. All algorithms are restated according to my own understanding. I hope it will be of some use to you.

Supongo que te gusta

Origin blog.csdn.net/Andrew_dlu/article/details/107839951
Recomendado
Clasificación