Skip to content

Commit 924fcf2

Browse files
committed
Updated linear search
1 parent 447ee32 commit 924fcf2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

pygorithm/searching/linear_search.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ def search(List, target):
1414
return -1
1515

1616
# time complexities
17-
def bestcase_complexity():
18-
return 'O(1)'
17+
def time_complexities():
18+
return '''Best Case: O(1), Average Case: O(n), Worst Case: O(n)'''
1919

20-
def averagecase_complexity():
21-
return 'O(n)'
22-
23-
def worstcase_complexity():
24-
return 'O(n)'
25-
26-
# easily retrieve the source code of the sort function
20+
# easily retrieve the source code of the search function
2721
def get_code():
2822
import inspect
2923
return inspect.getsource(search)

0 commit comments

Comments
 (0)