diff --git a/codes/go/chapter_computational_complexity/time_complexity_types.go b/codes/go/chapter_computational_complexity/time_complexity_types.go index 69b87a118..8488cacb7 100644 --- a/codes/go/chapter_computational_complexity/time_complexity_types.go +++ b/codes/go/chapter_computational_complexity/time_complexity_types.go @@ -117,7 +117,7 @@ func linearLogRecur(n float32) int { return count } -/* 阶乘阶(递归实现) */ +// factorialRecur 阶乘阶(递归实现) func factorialRecur(n int) int { if n == 0 { return 1 diff --git a/docs/chapter_computational_complexity/time_complexity.md b/docs/chapter_computational_complexity/time_complexity.md index 34315f5d9..13a52f154 100644 --- a/docs/chapter_computational_complexity/time_complexity.md +++ b/docs/chapter_computational_complexity/time_complexity.md @@ -116,7 +116,7 @@ $$ ```java title="" // 算法 A 时间复杂度:常数阶 - void algorithm_A(n int) { + void algorithm_A(int n) { System.out.println(0); } // 算法 B 时间复杂度:线性阶 @@ -1432,7 +1432,7 @@ $$ === "Go" ```go title="time_complexity_types.go" - /* 阶乘阶(递归实现) */ + // factorialRecur 阶乘阶(递归实现) func factorialRecur(n int) int { if n == 0 { return 1