将一个常见的循环转化为递归函数。
可见,递归函数与循环有很多类似之处。
As you can see, recursive functions and loops have quite a bit in common.
接下来,创建递归函数。
使递归函数不能得到正确的结果。
我怎么能连续的递归函数?
如何编写一个递归函数吗?
我们的下一个基于列表的递归函数示例要稍微复杂一些。
Our next example of a recursive function on lists will be a little more complicated.
此外,递归函数还会遇到浏览器调用栈大小的限制。
Further, recursive functions are more likely to run into browser call stack size limits.
您可以采用os. walk函数,而不必采用递归来完成相同的任务。
You could use the os.walk function to accomplish the same task without using recursion.
您可以使用尾递归(tail recursion)和XSLTtranslate()函数来完成这一步。
You'll use tail recursion and the XSLT translate() function to do this.
递归:函数对自身进行调用的过程。
The process of calling the function that is currently executing.
这里是一个通用的循环函数,它使得递归使用起来更加容易。
Here's a generic loop function making recursion easier to use.
递归是否是实现函数的最好方式,一定需要吗?
Is recursion the best way to implement the routine - is it necessary ?
递归是否是实现函数的最好方式,一定需要吗?
Is recursion the best way to implement the routine - is it necessary ?
应用推荐