递归调用(c语言)(Recursive call (C language))
递归调用(c语言)(Recursive call (C language))
Recursive call - mathematical view of recursionWhen I think of college, recursive calls have been such a headache. I've been teaching for nearly two years now, and I've got a clearer idea of recursion
Mathematics inside recursion, called recursion, is actually a recursive relationship. There is very typical of middle school mathematics is actually the practice of recursive part, but the teachers are not how to expand, new curriculum standards for the second chapter five series should be the concept of our first contact recursion.
In fact, when it comes to recursion, everybody knows that you're tuning yourself up, and that's what you all know, but how do you adjust it? How to control? And how do you see what you want? Believe or very dizzy, the following from middle school mathematics inside to have a look
The first part, two typical examples, arithmetic and geometric series
In fact, this is actually an example of teaching I often ask students: "what is the arithmetic progression?" Of course, the students will answer: "the latter is always more than the previous one, the number remains the same..." and some say: "the latter is minus the former as a constant."..."
So we often use expressions to represent
A (n) =a (n-1) +d
TeX syntax for
\[a_n=a_{n-1}+d\]
That's another problem. Is there a sequence here? Of course not, I said, the latter is 2 more than the previous one. What's the sequence?
Is it 1,3,5,7,9, or 2,4,6,8,10?,...
Of course, I don't know. Why? Since the series we are talking about needs to have a first item, that is, the value of the first item, so when it comes to the recursive sequence, there should be two elements, one is the relation between successive items, and the other is the first relation
Then you can use the superposition method to calculate:
Suppose the first item here is 1, that is, a (1) =1, and this constant is 2
that
A (n) =a (n-1) +2
A (n-1) =a (n-2) +2
A (n-2) =a (n-3) +2
A (n-3) =a (n-4) +2