当前计算的结果依赖于之前的部分结果,所以,在每次后续递归调用中,我们向前传递那些结果。
The result of the present computation depended on the partial results before it, so in each successive recursive call, we pass those results forward.
区别在于,使用递归函数极少被迫修改任何一个变量——只需要将新值作为参数传递给下一次函数调用。
The difference is that with recursive functions, you rarely have to modify any variable — you just pass the new values as parameters to the next function call.
为了在递归方法中传递,匿名类应该扩展方法已知的包装器类型。
To pass this to a recursive method, the anonymous class should extend a wrapper type known to the method.
第二个代码块(第6 -7行)只是将文档的根元素传递给我马上要谈到的递归修改方法。
The second code block (lines 6-7) just passes the root element of the document off to the recursive modification method I'll get to in a moment.
该表达式是对lazy - seq - fibo的一个递归调用,不过这次,它调用的是有两个参数的情况,并向其传递0和1。
That expression is a recursive call to lazy-seq-fibo, but this time, it is calling the two argument case, passing in 0 and 1 to it.
当传递列表' (“ho ” “wd ” “y ” “h ” “o ”)作为参数时,下面是递归输出。
When passing the following list as a parameter, '(" ho wd" "y" "h" "o"), the following is a walk-through of the output.
为此,它将选取列表的第一个元素 — 列表头部 —来对该元素执行处理,然后再递归式地将列表的其余部分传递给自身。
To do so, it will pick off the first element of the list — the head — to do the processing on that element, and recursively pass the rest of the list to itself again.
这个递归函数能很好地工作,不过它有一个主要的缺点 ——递归的每一次迭代都要为the-string传递相同的值。
This recursive function works fine, but it has one main shortcoming -- every iteration of the recursion will be passing the same value for the-string.
第二个方法递归地调用了自己,传递一个accumulator参数,这个参数是计算结果累积的地方。
The second method calls itself recursively, passing an accumulator parameter, where the result of the calculation is "accumulated".
但是t被递归地传递给count,和前面的示例一样。
But t is recursively passed to count again, just as with the earlier example.
如果为reveal传递一个无效的路径或“小圆点”(.,当前目录)或“两个小圆点”(. .,父目录),那么递归将结束。
If you pass reveal an invalid path or the perennial "dot" (., the present directory) or "dot dot" (.., the parent directory), the recursion ends.
典型地,我们在闭包里储存由我们的语义动作产生的临时变量,以之作为在递归下降中向上或向下传递信息的方法。
Typically, we store temporary variables, generated by our semantic actions, in our closure variables, as a means to pass information up and down the recursive descent.
给出了递归函数调用时利用变量传递解决复杂问题的实例,展示了递归算法在解决非数值运算问题中的独特解题方式和效果。
Examples are given for solving complex problem by transferring variables in recursive function program, and the recursive function programs show excellent capability for solving non-numeral problem.
设计并实现了一个面向教学的类c编译器,支持全局或局部变量的定义、函数参数传递和函数递归调用。
Designing and implementing a teaching-oriented C-like compiler, which supports the definition of local and global variables, function parameters, as well as recursive call of functions.
本文把四种方法统一写成递归格式,从理论上研究其共性特征,然后从递归公式所构造的数字滤波器的传递函数与理论传递函数比较的角度进行了分析。
The accuracy and the existent problem of forward difference method are analyzed on the basis of comparing the transfer function of recursive formula with theoretical transfer function.
本文把四种方法统一写成递归格式,从理论上研究其共性特征,然后从递归公式所构造的数字滤波器的传递函数与理论传递函数比较的角度进行了分析。
The accuracy and the existent problem of forward difference method are analyzed on the basis of comparing the transfer function of recursive formula with theoretical transfer function.
应用推荐