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 447ee32 commit 924fcf2Copy full SHA for 924fcf2
pygorithm/searching/linear_search.py
@@ -14,16 +14,10 @@ def search(List, target):
14
return -1
15
16
# time complexities
17
-def bestcase_complexity():
18
- return 'O(1)'
+def time_complexities():
+ return '''Best Case: O(1), Average Case: O(n), Worst Case: O(n)'''
19
20
-def averagecase_complexity():
21
- return 'O(n)'
22
-
23
-def worstcase_complexity():
24
25
26
-# easily retrieve the source code of the sort function
+# easily retrieve the source code of the search function
27
def get_code():
28
import inspect
29
return inspect.getsource(search)
0 commit comments