Skip to content

Commit 3a64865

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0610038 commit 3a64865

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

maths/fibonacci.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def fib_recursive_term(i: int) -> int:
122122
raise ValueError("n is negative")
123123
return [fib_recursive_term(i) for i in range(n + 1)]
124124

125+
125126
def fib_recursive_cached(n: int) -> list[int]:
126127
"""
127128
Calculates the first n (0-indexed) Fibonacci numbers using recursion.
@@ -155,6 +156,7 @@ def fib_recursive_term(i: int) -> int:
155156
raise ValueError("n is negative")
156157
return [fib_recursive_term(i) for i in range(n + 1)]
157158

159+
158160
def fib_memoization(n: int) -> list[int]:
159161
"""
160162
Calculates the first n (0-indexed) Fibonacci numbers using memoization
@@ -320,4 +322,3 @@ def fib_matrix_np(n: int) -> int:
320322
time_func(fib_recursive_cached, num) # 0.0153 ms
321323
time_func(fib_recursive, num) # 257.0910 ms
322324
time_func(fib_matrix_np, num) # 0.0000 ms
323-

0 commit comments

Comments
 (0)