To put it simply, the basis needed is as follows:
1, basic class (relative to ordinary undergraduates): (1) It is not difficult to learn the algorithm well with data structure, which is actually the application of graph theory. If you are not a math major, you can look at the graph theory part of discrete mathematics. (2) Mao Zedong's strategic thought of exchanging space for time is often used in algorithm analysis and calculation of space-time complexity of design. Therefore, it is necessary to learn simple order of magnitude operations, involving some knowledge of algebra and number theory. As long as you simply master the operation, you don't have to delve into it.
2. Improve (graduate level): Graph Theory, Combinatorial Mathematics and Mathematical Logic should be specially studied, and professional course textbooks such as Graph Theory, Combinatorial Mathematics and Mathematical Logic can be used for undergraduate students of mathematics department. Among them, combinatorial design in combinatorial mathematics is similar to algorithm design to some extent.
3. Research type (professional research): It mainly depends on your own research direction. If you have strong research ability, you can understand the mathematical knowledge you need to meet in a short time, and there is no ready-made fixed model. Among them, if we study NP problem, we need very deep logical knowledge and number theory foundation. But no matter which research direction, careful thinking and reasoning ability of mathematics are necessary, which can not be practiced overnight and needs long-term exercise.
The above is just a little personal experience for reference only.