How to learn data structure and algorithm? (Come on, you can do it)

Master a field (data structure and algorithm)

    1. Chunk it up

    Data structure ( https://naotu.baidu.com/file/b832f043e2ead159d584cca4efb19703?token=7a6a56eb2630548c)

    Pao Ding Jie Niu decomposes one knowledge point after another of the data structure

    It is important to view knowledge as sort of a semantic tree —— ElonMusk

    Qin Chao suggested to divide the data structure like this:

    • One-dimensional data structure
      • Basics: array (string), linked list
      • Advanced: stack stack, queue queue, double-ended queue deque, collection set, map (hash or map), etc
    • Two-dimensional data structure
      • Foundation: tree, graph
      • Advanced: binary search tree (red-black tree, AVL), heap heap, and disjoint set, dictionary tree Trie, etc
    • special
      • Bitwise operation, BloomFilter
      • LRU Cache

    Algorithm (All these complicated algorithms, in fact, what is the repeat unit at the end?) ( Https://naotu.baidu.com/file/0a53d3a5343bd86375f348b2831d3610?token=5ab1de1c90d5f3ec)

    • if-else, switch -> Branch

    • for, while loop -> Iteration

    • 递归 Recursion(Divide & Conquer, Backtrace)

    • Here is a segmentation. Below are some more advanced algorithms

    • Search Search: Depth first search, breadth first search, breadth first search, A *, etc

    • Dynamic Programming

    • Binary Search

    • Greedy

    • Mathematics, Geometry

      Note: Recall in your mind the thoughts and code templates of each algorithm above

      (Go ahead and draw the brain map)

  • Deliberate Practicing

    • Basic skills practice (basic skills are the fundamental distinction between amateur and professional players)
    • Decomposition training and repeated practice of basic movements->> The biggest misunderstanding (if you make an algorithm problem, if you only do it once, this is the biggest misunderstanding for you to practice and cut questions, which is far from enough)
    • Deliberate practice-pass the number of times (five questions, five poisonous palms)
    • Practice defects and weaknesses out of your comfort zone (dullness, tasteless irritability is growth), one foot outside the comfort zone
    • Professional training CSGO opens some maps for special exercises (I have practiced 233333 myself, whether it is CS or CS go)
    • O'Sullivan is really good
    • Don't be afraid of dynamic programming. After dozens of exercises, you must be very skilled.
  • Feedback

    • Instant feedback
    • Active feedback (find it yourself)
      • Master code (GitHub, LeetCode, etc)
      • First live view
    • Passive feedback (masters give you guidance (this is a bit difficult for me now, I can only find more friends)
      • code review

    LeetCode has a lot of very good code written by others

Ways to brush questions (four-piece set of cut questions)

  • Clarification (read the question a few times && communicate more with the interviewer to ensure that you understand the question correctly)

    It ’s important to see the topic clearly

  • Possible Solutions

    All possible ideas. Do n’t just use the first solution that comes to mind. To use all possible methods to find the best solution

    • compate (time / space)
    • optimal
  • Coding (write more)

  • Test cases (write a few more test cases to give the interviewer the feeling that he must have a beginning and an end)

Palm of the Five Poisons

Brush the question for the first time

  • Five minutes: reading questions + thinking (if the foundation is weak, you can give yourself 10 minutes up to 15 minutes) can not be skipped here
  • Have direct ideas to write directly || Timeout —— >> Direct reading method! note! Multiple solutions, compare the advantages and disadvantages of the solution (understanding that learning and applying algorithms is not for you to make wheels)
  • Recite and meditate in such a good way (not just rote memorization, after memorizing it first, it will generally be understood. Many problems will be conditioned reflex when you see it later) (cannot attack your enthusiasm)

Brush the question a second time

  • Write it yourself immediately (there may be bugs at the beginning. It does n’t matter debug debug debug modify modify modify) ——> LeetCode submit
  • Various writing styles and experience ——> Optimization! (The most important thing is the execution time)

Brush questions for the third time

  • After 24 hours, repeat the question again
  • Proficiency in different solutions-> special exercises

The fourth pass

  • After a week: come back to practice the same problem repeatedly

Fifth time

Restorative training one week before the interview

Guess you like

Origin www.cnblogs.com/ssaylo/p/12676845.html