1. No mathematical basis for programming
2, but understand math does not mean to understand programming
To give an example:
Seek the 1+2+3+4+......+99+100 and.
The mathematical solution is usually:
1, (1+100) *100/2=5500
2, the pupil's solution: 1+2=3, 3+3=6 、...... So tired to go on.
What about the programming solution? The same as the mathematical solution 2, the code is as follows:
Static void Main (string[] args) { int0; for (int1; + +i) { + = i; } Console.WriteLine (Theresult.tostring ()); }
So:
When programming solves a problem, you need to understand several logical reasons:
1, the computer operation speed is very fast
2, the computer will not be wrong, unless your code has a bug
So:
For example, 1 to 100 of sums, mathematics can use skills, program (computer) because he is fast and can not make mistakes, the most stupid way to calculate.
This is programming thinking and mathematical thinking.
The programming algorithms are:
1. Poor Lifting method
2. Greedy algorithm
3. Dynamic Programming method
Wait a minute
The example above is the poor lifting method in the programming algorithm.
Mathematical thinking and programming thinking