• Eight queens problem — recursive backtracking


    1. Eight queens Put eight queens on the 8 × 8 chessboard so that they can’t attack each other, that is, any two Queens can’t be in the same row, the same column or the same diagonal line. How many kinds of pendulum are there. 2. Ideas This problem is very suitable to be solved […]

  • Array of algorithms — the maximum number of points in a common line


    The maximum number of points on a line difficultydifficulty Given a two-dimensional plane, there are n points on the plane, find the maximum number of points on the same line. Example 1:Input: [[1,1],[2,2],[3,3]]Output: 3Explanation: Example 2:Input: [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]]Output: 4Explanation: thinking First, you need to make sure that two points are on a straight line – that […]

  • JS + CSS3 to achieve image slider effect


    effect Analyzing the animation can be divided into two steps: Add an animation class when the mouse moves in or out Realize the animation class and move in and out animation Picture waterfall flow layout can refer to Vue handwritten picture waterfall flow component (with source code) HTML and CSS layout The layout is relatively […]

  • Canvas simple line animation


    Introduction: the simple line animation of canvas animation introduction series. Although it’s simple, there are quite a lot of wired animation application scenes, so I made a small demo, which is all in one. Step1: draw points Create tags first<canvas id=”canvas” width=”400″ height=”400″></canvas>Set the coordinates of several points const points = [ [200, 100], // […]

  • Basic theory calculus


    limit limit Slope The slope is positive and negative: The slope is a positive number, indicating that the original function is positively correlated with the independent variable, On the contrary, the original function is negatively correlated with the independent variable. The positive and negative slope can be used as a condition to judge the extreme […]