递归函数
什么是递归函数:
Technically, a recursive function is a function that makes a call to itself. To prevent infinite recursion, you need an if-else statement (of some sort) where one branch makes a recursive call, and the other branch does not. The branch without a recursive call is usually the base case (base cases do not make recursive calls to the function).
从技术上讲,递归函数是一个对自己进行调用的函数。为了防止无限递归,你需要一个 if-else 语句(或它的某种形式),其中一个分支进行递归调用,而其他分支不进行递归调用。没有递归调用的分支通常是基础案例(基础案例不对函数进行递归调用)。