We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d48190 commit 2796b65Copy full SHA for 2796b65
pydatastructs/multi_threaded_algorithms/fibonacci.py
@@ -12,6 +12,8 @@ class Fibonacci:
12
"""
13
14
def __init__(self, n, backend='python'):
15
+ if n<0:
16
+ raise ValueError("n cannot be negative")
17
self.n = n
18
self.backend = backend
19
self.result = [None] * (n + 1) # To store Fibonacci numbers
0 commit comments