Many front-end children have inexplicable fear of the algorithm, investigate its reasons no more than two points: first, do not understand the algorithm; Second, no practical application scenarios were found.

Why learn algorithms?

It’s an interesting question, and people who are interested in algorithms, don’t need to ask why, algorithms might be of interest to them. I once had a colleague who went through all the algorithm problems, and whenever there was an algorithm contest, he would take part. Of course, also achieved good results, even has its own world ranking.

When I popped the question during a casual conversation, he laughed and said, “No reason, just for fun.” I have always wondered why someone would find algorithms funny and what is the point of interest?

In fact, interest is part of it, and the other part is the improvement of programming ability and expansion of thinking.

Programming languages are important, but algorithms and theories are more important because computer languages and development platforms change every day, but it’s those algorithms and theories that stay the same.

To see the difference, let’s use two interesting diagrams:

1. Before learning an algorithm, you might:

2. Learning algorithms makes you smarter:

Two, how to get started?

So how do you learn an algorithm? I recommend a book called Diagrams of Algorithms, a slim little volume. In the book, some simple and interesting examples are used to illustrate the application scenarios of the algorithm. It was chosen as a primer because we can read it in a very short time.

If you still have trouble, don’t worry, I’ve prepared your study notes for you:

  • Algorithm diagram 1 – binary search and big O notation
  • Algorithm diagram 2 – Arrays and linked lists
  • Algorithm diagram 3 – Recursive, fast sorting
  • Algorithm diagram 4 – hash table
  • Algorithm Diagram 5 – Graph and breadth first search
  • Algorithm diagram 6 – Dikstra algorithm and greedy algorithm
  • Algorithm Diagram 7 – Dynamic programming

The book is written around Python, in order to be more suitable for front-end children to read, I have put the relevant code in JS implementation again. Of course, there are still a lot of details that need to be understood in depth. But at the very least, I’m not afraid of algorithms anymore, and I’m starting to like them.

The priority of algorithm is to cultivate algorithm thinking.

When you can play around with algorithms, you’re done.

Three, which way is the back?

Getting started is never an easy thing, and there will be more treasures to be discovered after we open this mysterious door.

There are many more goals we need to accomplish after reading the first book in order to become proficient in algorithms. Here is a list of some classic books on algorithms for your reference:

1. Introductory series: Algorithm Diagram and Big Talk Data Structure

2. Textbook: Data Structure and Algorithm Analysis

3. Advanced Journey: Introduction to Algorithms

4. Preparation for interview: “Sword Finger Offer” and “Programming Abas”

5. Extended Reading: Beauty of Algorithms, Empire of Algorithms

6. Practical operation: Classic Introduction to Algorithm Competition and Question Bank

Algorithms actually have a lot of classic books, we don’t have so much time to go through them, but we can have a clear learning route.

This learning route is: entry – advanced – practice – sublimation

Fourth, cooperate with practice

In fact, as mentioned above, the most important thing is to brush the questions after we master the algorithm thinking. I believe that many children have heard of LeetCode. There are about 1000+ questions in the question bank at present. Go to brush them when you are free.

5. Recommend learning

1.JavaScript algorithms and data structures

2. A good tool for visual learning algorithms

3. What are the most common interview algorithms used by Internet companies?

4. Algorithm practice, brush with me

Six, summarized

The article said so much, generally summarized as follows:

  1. Algorithms are important, especially for the front end;
  2. Algorithm learning is best from shallow to deep, first understand the algorithm thinking, and then to understand the practical application;
  3. Start from a small and thin book and gradually master the relevant knowledge system comprehensively;
  4. Recommended quick route: “Algorithm diagram” – “Sword Finger Offer” – LeetCode brush – “Beauty of algorithms” – “Introduction to Algorithms”;
  5. To practice hard, brush the question bank, participate in the competition;

Well, that’s all, I wish you an early fix algorithm, take the crown of the algorithm, to enjoy the beauty of the algorithm.