From c94b3a5617c3637941a4fad4848adca5ab81bec2 Mon Sep 17 00:00:00 2001 From: ITCharge Date: Mon, 13 May 2024 23:06:45 +0800 Subject: [PATCH] Update 01.Recursive-Algorithm.md --- .../02.Recursive-Algorithm/01.Recursive-Algorithm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contents/09.Algorithm-Base/02.Recursive-Algorithm/01.Recursive-Algorithm.md b/Contents/09.Algorithm-Base/02.Recursive-Algorithm/01.Recursive-Algorithm.md index 16ef0dfb..2884b423 100644 --- a/Contents/09.Algorithm-Base/02.Recursive-Algorithm/01.Recursive-Algorithm.md +++ b/Contents/09.Algorithm-Base/02.Recursive-Algorithm/01.Recursive-Algorithm.md @@ -4,7 +4,7 @@ 举个简单的例子来了解一下递归算法。比如阶乘的计算方法在数学上的定义为: -$fact(n) = \begin{cases} 1 & \text{n = 0} \cr n * fact(n - 1) & \text{n > 0} \end{cases}$ +$fact(n) = \begin{cases} 1 & \text{n = 0} \cr n \times fact(n - 1) & \text{n > 0} \end{cases}$ 根据阶乘计算方法的数学定义,我们可以使用调用函数自身的方式来实现阶乘函数 $fact(n)$ ,其实现代码可以写作: