[The Beauty of Data Structures and Algorithms] 01-How to grasp the key points and learn the data structures and algorithms systematically and efficiently?

1. What is a data structure and what is an algorithm

  The definition of overly academic concepts is relatively abstract and difficult to understand. We understand the two concepts of data structure and algorithm from the broad and narrow levels.

Generalized angle

  Broadly speaking, data structure refers to the storage structure of a group of data. An algorithm is a set of methods for manipulating data. In short, the data structure solves the "how to put" the data, and the algorithm determines the "how to use" the data.

  Let's take the library scene as an example to further understand:

  The volume of books in the library is huge. First, we must set up reading rooms by category, such as social sciences, science and technology, and newspapers. In each reading room, they are arranged according to the index number of the book. This is the "data structure". When we want to borrow a book, we can go to each reading room to find one by one, or search the index number to go directly to the corresponding reading room. These different search methods are actually "algorithms".

2. Narrow angle

  In a narrow sense, it refers to some typical data structures and algorithms, such as queues, stacks, heaps, binary search, and dynamic programming.

 

Second, the relationship between data structure and algorithm

  The two concepts of data structure and algorithm have the meaning of "focus is not off, Meng is not off focus". The reason we always put them together is because the data structures and algorithms are complementary. The data structure is for the algorithm, the algorithm should act on a specific data structure. We cannot isolate the data structure in terms of algorithms, nor can we isolate the algorithms in terms of data structures. The data structure is static, it is just a way to organize data. If you do n’t operate and build algorithms on top of it, it is useless to isolate existing data structures.

 

3. Learning focus

1. Complexity analysis

  To learn data structures and algorithms, we must first grasp the most important concept in data structures and algorithms-complexity analysis.

  Complexity analysis accounts for almost half of the data structure and algorithm course, and is the essence of data structure and algorithm learning. Data structures and algorithms solve the problem of how to store and process data more economically and faster. Therefore, a method of considering efficiency and resource consumption is required. This is complexity analysis. It can be said that the complexity analysis is the Jiuyang Divine Skill. With the foundation of internal skills, it will be quick to learn the moves.

2. Data structure and algorithm body

  Let ’s first look at a frame diagram in order to establish an overall understanding of data structures and algorithms:

  

  Of course, as beginners or non-algorithmic engineers, we do not need to master all the knowledge points in the above picture. Many advanced data structures and algorithms are rarely used in daily development, such as bipartite graphs and maximum flow. Learning to grasp the main contradictions, and conquer the following two "top ten" is enough to deal with interviews and daily work:

  Top ten data structures

  Array, linked list, stack, queue, hash table, binary tree, heap, jump table, graph, Trie tree;

  Top ten algorithms

  Recursion, sorting, binary search, search, hash algorithm, greedy algorithm, divide and conquer algorithm, backtracking algorithm, dynamic programming, string matching algorithm.

  Master these basic data structures and algorithms, and then learn more complex data structures and algorithms, it is easy to get started.

 

4. Learning methods

  In the process of learning data structures and algorithms, we must pay attention to, not rote. Pay attention to the following four issues: "origin", "self-characteristics", "problems suitable for solving", "actual application scenarios". The process of learning data structures and algorithms is a very good process of thinking training. Therefore, do not passively remember, think more dialectically, and ask why.

1. Learn while practicing, brush questions appropriately

  Data structures and algorithms have high requirements for practice. In addition to the hands-on practice in the learning process, it takes another 1 to 2 hours a week, focusing on the data structures and algorithms involved in this week's learning, all written by yourself, and implemented in code. This will be much better than simply watching or listening.

  As for the preparation before the interview, you still need to brush the right amount of questions. Don't waste too much time on brushing questions. Unless you want to interview companies like Google and Facebook, their algorithmic questions are very, very difficult, and you have to brush a lot of questions in order to improve the test accuracy rate in the short term. If it is a technical interview for a domestic company, even BAT, as long as you are proficient in the principles and practiced in moderation, it is enough.

2. Think more and discuss more

3. Limited time

  One of the concepts that I benefited from watching New Oriental ’s vocabulary lessons when I was in college was: I must set up a detailed time plan for learning. Do n’t stretch the front too long, and use concentrated time to complete the study. Otherwise, if a semester passes, you may still stay in the abandon. I think this is a general principle. When studying data structures and algorithms, you should also make a good time plan for yourself.

4. Small goals

  In the boring learning process, you can set yourself a practical goal, just like Daguai upgrade. For example, write a blog after each part of the study, or find areas where the information is incorrect or can be improved. This can lead to positive feedback for learning.

5. Repeat

  Learning is a process of repeated iteration and continuous precipitation. Don't expect to achieve it overnight. It is normal for some knowledge points to be learned once and cannot be fully understood. Repeatedly studying a few times, you will certainly be able to "know what is new".

Guess you like

Origin www.cnblogs.com/murongmochen/p/12678628.html