This article will be updated constantly to record the summary of my brush algorithm and the link to the analysis of each question;
Summary and Reflection
-
When solving the algorithm, try to use JS native methods, because JS native methods generally have low time complexity and space complexity; (eg: array.sort() time complexity is O(nlog_2n));
-
An algorithm is actually a way to solve a problem, step by step, always achieve the goal;
For general problems, we have general ideas (divide and conquer, dynamic programming, greed, backtracking) that give us general directions;
But in fact, when dealing with the problem, the problem does not clearly belong to a certain category, then we need to find the appropriate algorithm according to the constraints and rules of the problem, and on the basis of the appropriate algorithm, each step of the algorithm using a better method to optimize it, reduce the time complexity or space complexity; (Eg: If a certain step of an algorithm can be solved using bit operations, the time complexity will be effectively reduced)
-
Time complexity and space complexity are often negatively correlated. Low time complexity programs can be obtained by increasing the space complexity of programs.
The title corresponds to the article link
An array of
- Valid sudoku
- Rotate the image