diff --git a/docs-en/chapter_computational_complexity/space_complexity.md b/docs-en/chapter_computational_complexity/space_complexity.md index 726e9346e..6e7be8104 100644 --- a/docs-en/chapter_computational_complexity/space_complexity.md +++ b/docs-en/chapter_computational_complexity/space_complexity.md @@ -476,9 +476,10 @@ Consider the following code, the term "worst-case" in worst-case space complexit for _ in range(n): function() - def recur(n: int) -> int: + def recur(n: int): """Recursion O(n)""""" - if n == 1: return + if n == 1: + return return recur(n - 1) ``` diff --git a/docs/chapter_computational_complexity/space_complexity.md b/docs/chapter_computational_complexity/space_complexity.md index 083f1c1fe..a6534fbe8 100755 --- a/docs/chapter_computational_complexity/space_complexity.md +++ b/docs/chapter_computational_complexity/space_complexity.md @@ -475,9 +475,10 @@ for _ in range(n): function() - def recur(n: int) -> int: + def recur(n: int): """递归的空间复杂度为 O(n)""" - if n == 1: return + if n == 1: + return return recur(n - 1) ```