How to teach yourself data structures and algorithms for a good job

How to learn data structures

How to learn data structures

How to learn data structures

1. Choose a suitable book

Ichiaka Ruined Points recommends this Orange Book of Princeton: Algorithms, Fourth Edition, which is the most suitable for getting started in my opinion. The Orange Book downplays algorithmic analysis and proofs, emphasizes implementation and applications, and shows how good algorithms can be efficient in time and space compared to data structures through some interesting exercises.

2. Programming Realizations and Applications

Understanding a data structure is a completely different challenge than programming its full functionality. Do-it-yourself implementations of simplified APIs for some basic data structures (such as sorting, sets with socks only, graphs, and string manipulation) can greatly improve your understanding of the internal details of a data structure.

3. Repeated learning

Because algorithms and data structures cover a lot of knowledge, so the content of a book may need to be divided into several phases of learning, and it is inevitable that you will forget what you have learned before. I recommend agile learning and working backwards as quickly as possible. If a knowledge point really do not understand, Huixiong can be doubtful “not to seek understanding”, many times after the back of the study, some of the contents of the front will naturally understand. Then repeat the study.

The data structure is a collection of data elements that have one or more specific relationships with each other. Often, a carefully chosen data structure can lead to greater operational or storage efficiency. Data structures are often associated with efficient retrieval algorithms and indexing techniques.

The logical structure and the storage structure of data are two closely related aspects of data structure, and the same logical structure can correspond to different storage structures. The design of an algorithm depends on the logical structure of the data, while the implementation of the algorithm depends on the specified storage structure.

The research content of data structure is the foundation for constructing complex software systems, and its core technology is decomposition and abstraction. Through decomposition, the three levels of data can be divided; then through abstraction, the specific content of the data elements are discarded, and the logical structure is obtained. Similarly, through decomposition the processing requirements are divided into various functions, and then through abstraction the realization details are discarded, the definition of the operation is obtained.

Data structures and algorithms for beginners how to get started

Algorithms for computer programming is like the Goldbach’s Conjecture in number theory in mathematics, although it is not so difficult, but its place is also very important. Data structures and algorithms are the core of programming ideas, it means the basic level of a programmer. A good algorithm is crucial for a good project, if you can’t have your own building in the algorithm, software programming to the head is just a coder.

📚Reference books

Even if you can’t read them all, you should always have them on hand. The existing data structures and algorithms, how to realize is the last section, can understand the principle, understand the application of the occasion is the key.

👨‍💻 read more open-source works

Read more open-source works, see how they are skillful application of those basic data structures and algorithms, you can also go to the small code brother Mingjie Li to understand the knowledge about data structures and algorithms.

🔍No need to over-pursuing weird algorithms

No need to over-pursuing weird algorithms, what is applicable is the best, and what is simple is the best.


Finally, I hope you will be able to build on your integration and learn from it.

The most complete self-study guide to computer fundamentals!

The most complete self-study guide to computer fundamentals is as follows:

1, data structures and algorithms

Programs = data structures + algorithms.

Data structures are often put together with algorithms, and in some colleges and universities, there are two courses, “Data Structures” and “Algorithm Design and Analysis”.

This has caused many students to be confused, what is the difference between data structures and algorithms? Some students even think that it is a kind of.

In fact:

Data structure mainly explains the organization of data. It is how we are going to store this data, so there are arrays, chain lists, stacks, queues, trees, graphs, which is the focus of data structures.

Algorithms, on the other hand, focus on ideas. For example, how to sort the elements in the array, how to find the largest number and the smallest number and so on. To put it bluntly, it’s the idea of solving problems in reality. That’s why there are these algorithms like greedy, dynamic programming, etc.

Data structures and algorithms, no matter how you think, must be seriously learn! It’s a must for both interviews and grad school!

The following summarizes some important knowledge points, so that you can have targeted learning.

[Complexity analysis]

Time complexity

Space complexity

Learning data structures and algorithms of the first lesson, I always choose complexity analysis, in my opinion, this is the most important data structures and algorithms in the most important knowledge points, and do not accept any refutation.

Article recommendation:

Nanny Teaching! Thoroughly learn time complexity and space complexity

[Data Structure]

Array: An array is an aggregated data type, which is a collection of a number of variables with the same type organized in an orderly fashion.

LinkedList: A linked list is a data structure in which data elements are stored according to a chained storage structure that is characterized by physical discontinuities.

Stack: Stack is a special kind of linear table, it can only be in a table at a fixed end of the insertion and deletion of data nodes.

Queue (Queue): queue and stack are similar, is also a special linear table. Unlike a stack, a queue only allows insertion operations at one end of the table and deletion operations at the other end.

Hashtable: Hashtable is derived from the hash function (Hashfunction), the idea is that if there is a record in the structure of the keyword and T is equal, then the record must be found in the storage location of F (T), so that you can directly obtain the record without comparison.

Heap: Heap is a special kind of tree data structure, generally discussed heap is a binary heap.

Tree: Tree is a typical non-linear structure, it is including, 2 nodes of the poor set K.

Graph: Graph is another non-linear data structure. In a graph structure, data nodes are generally called vertices and edges are ordered even pairs of vertices.

[Manipulating Data Structures]

Find: Finding a node in a data structure that satisfies certain conditions. Generally, given a value of a field, find the node with that field value.

Insert: add a new node to the data structure.

Delete: removes the specified node from the data structure.

Modify: changes the value of one or more fields of the specified node.

Sort: rearranges the nodes in some specified order. For example incrementing or decrementing.

[Data Structure Books Recommended]

Data Structures, Data Structures and Algorithm Analysis

Data Structures is a book that is more interesting and easy to read, and the algorithms are explained in detail compared to similar data structure books on the market.

It is a great read for self-study.

This book is narrated in a fun way, with a lot of references to a variety of life knowledge to analogize, and fully utilizes the graphical language to reflect the abstract content, and some of the classic algorithms involved in data structures to do line-by-line analysis, multi-algorithm comparison.

If you still can’t understand, you can look at the diagrams I wrote, but it’s a bit slow, but absolutely easy to understand:

Arrays: Eggs suffered an arrays Waterloo, and the interviewer suggested to go back to the village to raise pigs.

Chained table: chained table, draw a few times on the whole understand!

Stack and queue: tie! “Stack” live, queue!

Strings: Do you know this about strings?


The formula for learning algorithms is simple: read more, write more, and get on the computer more.

Backtracking algorithms

Partitioning algorithms

Enumeration algorithms

Greedy algorithms

Dynamic programming

Finding algorithms

Dichotomous finding

Hash table finding

Tree structure finding

String matching

String matching

Brutal matching

KMP Algorithm

Top 10 Sorting Algorithms

Bubbling Sort

Selection Sort

Insertion Sort

Hill Sort

Parametric Sort

Hex Sort

Hex Sort

Rapid Sort

Count Sort

Base Sort

Bucket Sort

Bucket Sort

[Recommended Algorithm Books]

Algorithms Illustrated

Example-rich and richly illustrated, this is an introductory algorithm book that reads like a novel.

Whether you are a professional programmer, a programming enthusiast, or a computer science major who needs to revisit algorithms, this is the book for you.

The first three chapters of the book will help you lay the groundwork, taking you through binary lookups, big-O representations, two basic data structures, and recursion.

The remainder of the book will focus on algorithms with a wide range of applications, specifically: solution techniques when faced with specific problems, such as when to use greedy algorithms or dynamic programming; applications of hash tables; graph algorithms; and the Kzui nearest neighbor algorithm.

Algorithms (4th Edition)

The classic reference in the field of algorithms contains the core body of knowledge on algorithms that has evolved over decades.

The book explains a wide range of algorithms and data structures, enabling you to implement, debug, and apply them in a variety of computer environments.

A classic reference in the field of algorithms, it provides a comprehensive introduction to the essential knowledge about algorithms and data structures, with special treatment of sorting, searching, graph processing, and string processing

The 4th edition specifically gives 50 algorithms that every programmer should know and know how to do, with actual code provided.

[Video Tutorial Recommendation]

“Data Structures”, co-taught by ZJU professors Chen Yue and He Qinming, the course is great system is complete, the class experience is good, while the difficulty factor is online, the quality is also very good. Can learn a lot of thinking methods and skills, want to learn a good data structure students should not miss.

“Data Structures and Algorithms”, the most important feature of this course is the combination of theory and practice, you will learn the algorithmic skills to solve a variety of computational problems and implement about 100 algorithmic coding problems.

[Website Recommendation]

If you still find it overwhelming to learn, you can take the help of the following website.

VisuAlgo, a dynamic visualization site for data structures and algorithms.


Data structures and algorithms learning, often accompanied by “brush”, if there are no special circumstances, I recommend that we brush LeetCode is good.

For LetCode, there are many solutions to the problem, and we tend to pursue the optimal solution. Here is a copy of the optimal solution of LetCode organized by the president of Tsinghua University, which is highly recommended:

The two should work together to make it very comfortable.

2, the principle of computer composition

The principle of computer composition, that is, “computer” “composition” of the “principle”.

I think it is the most difficult of all basic computer courses, the core of the entire course is to use digital logic circuits and triggers to build a machine that can run assembly instructions.

[Book recommendation]

How Computers Run, How Programs Run.

It’s precisely because Computer Composition Principles is so difficult to learn that the choice of introductory books for beginners has to be friendlier for this class than for a few others.

“How Computers Run” and “How Programs Run”, which are two very thin books where the authors present their knowledge in a big vernacular, illustrated, and quite NICE for beginners.

“How Computers Run”

“How Computers Run”

This book advocates a return to the computer in a world where computers are rapidly evolving, and where technology continues to be revolutionized. to the basics. By exploring the nature of computers, it promotes engineers’ interest in computers and their ability to quickly grasp the essentials and apply them flexibly when confronted with the complexities of the latest technology.

How Programs Work

This book starts with the internal structure of a computer and explains in detail, in the form of diagrams and text, binary, memory, data compression, source and executable files, the relationship between the operating system and the application program, assembly language, and hardware control methods, etc. The purpose is to let readers understand what really happens from the time the user double-clicks on the program icon to the time the program starts to run. What really happens.

[Video Recommendation]

The first video in Carnegie Mellon University’s Deeper Understanding of Computer Systems series. It doesn’t matter, there are Chinese and English subtitles, after watching this set of videos, the knowledge + sixth grade smoothly get hand.

Watch this video supporting textbook is “Deeper Understanding of Computer Systems”.

3, operating system

No matter what language you study, you can’t avoid dealing with the operating system. The final execution of all the language, are relying on the operating system. For example, if you learn Java and use multithreading technology, the operating system is actually responsible for managing processes and threads.

Without understanding the operating system, you will be confused when you learn the advanced features of programming languages in the future, when it comes to threading, process scheduling, memory allocation, or when you learn about Linux.

Only if you learn the operating system, you will be able to learn other languages and technologies better. Therefore, the operating system is a must for programmers to advance their knowledge.

[Book Recommendations]

Recommendations for getting started: Introduction to Operating Systems, Modern Operating Systems.

In-depth series: “In-depth understanding of computer systems”, to understand computer systems from the programmer’s point of view.

This is an introductory level book, which is not really “in-depth”, it talks about relatively shallow content.

The “breadth of coverage” is really the best thing about this book. It tells us how computers are designed and work, what the operating systems focus on, and what they do.

After taking a look at this book, we can have a rational understanding of how the components of a computer system work. To a certain extent, it is actually an exercise in thinking – computational thinking.

[Video Recommendations]

Operating system, to be honest, in the beginning of learning is not recommended to directly bored to read the book. Because the book looks really meaningless.

Here we recommend Tsinghua University’s operating system course, divided into upper and lower. When you watch the video, you can combine it with the [book recommendation] above.

When you watch (upper), you can combine it with Introduction to Operating Systems, and when you watch (lower), you can combine it with Modern Operating Systems.

4, computer networks

Computer networks related knowledge used more often at work.

Learning computer networks, you need to know Socket programming, know the TCP/IP network model, understand the OSI seven-layer network architecture, know how a packet of data layers of packaging, and then layers of unpacking, from the client to the server.

But computer networks are much better, because they are not abstract, in real life, can find examples.

[Book Recommendation]


The illustrations, simple and easy to understand, very suitable for the beginning. It’s not easy to write a book that is thin and readable and covers the major areas of knowledge. This book does that and does it quite well from the level of coverage of HTTP knowledge to the ease of reading.

This book features a large number of vivid communication illustrations to help readers better understand the interaction between the client and the server during HTTP communication.

Computer Networks

The vast majority of them are using Xie Xiren’s book Computer Networks, which is very good and easy to understand, and is also a common textbook for the 408 exam.

[Video Recommendation]

First of all, we must strongly push the computer network microclassroom of the University of Lake Teachers, a moving picture to do the best computer network video course, the teacher lectures logical and clear and especially easy to understand.

5, database

Database is the place to store data, but it is not just that simple.

Learning database, not only to understand the SQL statement, table design structure of these basic parts, but also understand the index, slow query optimization, configuration parameters tuning.

A little more in-depth, but also to learn SQL optimization, backup and recovery, architecture optimization and other advanced content.

[Book Recommendations]

Introduction Series: SQL Basic Tutorial, SQL Study Guide, Introduction to Database Systems.

This book introduces a more gentle pace, and with illustrations and keywords bold more vivid introduction to knowledge, suitable for zero-basic students.

For those with no prior knowledge, Mick’s sql basics is easier to read and learn, and is ideal for beginners.

In-depth series: “MySQL Technology Insider – InnoDB Storage Engine”, “Redis Design and Implementation”.

How to learn data structures and algorithms

1, have a good interest in learning

(1) pre-study before class, questions and curiosity about what you learn.

(3) Thinking about the problem pay attention to generalization, tap your potential for learning.

(4) listen to the class pay attention to the teacher’s explanation of the mathematical ideas, and ask more questions about why think in this way, and how such a method is produced.

(5) Return concepts to nature. All subjects are generalized from practical problems, mathematical concepts also return to real life, such as the concept of angle, to the intersection of the generation of the coordinate system, the generation of the polar coordinate system are abstracted from real life. Only return to reality can make the understanding of the concept of practical and reliable, in the application of the concept of judgment, reasoning will be accurate.

2, the establishment of good learning math habits.

Habits are stable and long-lasting reflexes and natural needs that are consolidated through repeated practice. The establishment of good study math habits, will make their own learning feel organized and easy. Good habits in high school mathematics should be: more questioning, hard thinking, good hands-on, heavy generalization, attention to application. In the process of learning mathematics, students should translate the knowledge taught by teachers into their own special language and memorize it permanently in their minds. In addition to ensure a certain amount of self-study time every day in order to broaden their knowledge and develop their ability to learn again.

3, consciously cultivate their own ability

Mathematical ability includes: logical reasoning, abstract thinking, calculation, spatial imagination and analytical problem-solving ability. These abilities are developed in different math learning environments. In ordinary learning, we should pay attention to the development of different learning places and participate in all useful learning and practical activities, such as the second classroom of mathematics, math contests, quiz competitions and other activities. Usually pay attention to observation, for example, spatial imagination ability is purified thinking by example, the entity in space is highly abstracted in the brain, and analytical reasoning in the brain. All other abilities must be developed in learning, understanding, training, and application. In particular, in order to cultivate these abilities, teachers will carefully design “intellectual lessons” and “intellectual problems”, such as the answer to the problem of multiple solutions, the training of categorization, the application of models, computers and other multimedia teaching, etc., are for the cultivation of mathematical ability. The opening of a good type of class, in these classes, the students must use the whole body and mind, all-round intellectual participation, and ultimately to achieve the overall development of their own ability in all aspects.

Other notes

1, pay attention to the study of the idea of transformation.

People learning process is to use the knowledge to understand, solve the unknown knowledge. Mathematics learning process is to use the old knowledge to lead and solve new problems, when the new knowledge mastered and then use it to solve the newer knowledge. Middle school knowledge is the foundation, if you can use the new knowledge with the old knowledge to answer, you have the idea of transformation. It can be seen that learning is constantly transforming, constantly inheriting and developing and updating old knowledge.

2, learn the mathematical material of mathematical thinking.

Mathematical textbooks are used to imply the disclosure of mathematical ideas dissolved in the mathematical knowledge system, therefore, the mathematical ideas to make timely induction, generalization is very necessary. Generalization of mathematical ideas can generally be divided into two steps: one is to reveal the content of mathematical ideas law, that is, the mathematical object of its attributes or relationships extracted, and the second is to make clear the connection between the knowledge of mathematical ideas and methods, to extract the framework for solving the whole. Implementation of these two steps can be carried out in the classroom listening and self-study outside the classroom.

Several suggestions for learning mathematics

1, take mathematical notes, especially on the different sides of the conceptual understanding and mathematical laws, teachers to prepare for the college entrance exams and add extracurricular knowledge.

2, create a math error correction book. Record the knowledge or reasoning that is usually prone to errors in order to prevent recidivism. Strive to do: find the wrong, analyze the wrong, correct the wrong, prevent the wrong. To achieve: can start from the opposite in-depth understanding of the right things; can be from the fruit of the cause of the error to get a waterfall, so that the right medicine; answer the question of complete, rigorous reasoning.

3, memorization of mathematical laws and mathematical conclusions.

4, and classmates to establish a good relationship, and strive to be a “small teacher”, the formation of math learning “support group”.

5, to do math outside the classroom, increase self-learning.

6, repeated consolidation, eliminating the learning before forgetting.

7, learn to summarize the classification. Can be: ① from the mathematical idea of classification ② from the method of categorization ③ from the application of knowledge on the classification

Learning accounted for the first, every student can do. The reason why you can not account for the first, there are two main reasons: first, the way of life, learning method is not correct, second, no strong perseverance. In this perseverance is the first important, learning method is the second important.

How to learn data structures algorithms work better, need to write each program

1. program = data structures + algorithms

2. learning: when you first start to look at it will certainly be a little unclear, because you are just learning the C language, the C language is not yet very skilled. You learn data structure to find a classic data structure book, read a data structure and then use C to realize it. At the beginning of the realization will certainly be difficult, then please google down there will be a lot of excellent data structure source code. You can imitate these excellent source codes to write. Remember to implement it yourself at the beginning, and when you get stuck, look at the source code to see what you are stuck on and draw attention to it so that you can write it yourself next time. Once you’ve written the source code for the data structures in the book, you’ve surpassed the vast majority of your classmates.

3. Utilization: At this point, you need to use these data structures, you can google “some data structure + ACM”, you will see some questions, these questions are the use of the data structure, and even the data structure of the deformation. Do about 5 questions on each data structure. During the period you will also encounter another important aspect of the program algorithms, there will not be on the google. during the period of data structures and algorithms you can learn to do a small software to play, such as compression software, backgammon, and so on.

4. In-depth: When you have completed the third step you are already a small master of your school. At this point, depending on your direction, if you find that you like ACM at this point, then go to the ACM, if not interested in, to find their own interest in technology to learn, do a few complete projects, such as writing a compiler, or the implementation of a simple programming language.

Summary: No matter which path you choose as long as you follow these and do it, you will definitely become a hot commodity later.