说起尾递归就不能不提一下尾调用(Tail Call)。
尾调用:在函数的最后一步调用另外一个函数。
function func(){
// ... other code
return otherFunc();// 尾调用
}
尾递归:在函数的最后一步调用自身
function func(){
// ... other code
return func();// 尾递归
}
说起尾递归就不能不提一下尾调用(Tail Call)。
尾调用:在函数的最后一步调用另外一个函数。
function func(){
// ... other code
return otherFunc();// 尾调用
}
尾递归:在函数的最后一步调用自身
function func(){
// ... other code
return func();// 尾递归
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。