Skip to content

Commit 447ee32

Browse files
committed
Updated binary search
1 parent fa74e51 commit 447ee32

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

pygorithm/searching/binary_search.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,10 @@ def search(List, target):
2323

2424

2525
# time complexities
26-
def bestcase_complexity():
27-
return 'O(1)'
26+
def time_complexities():
27+
return '''Best Case: O(1), Average Case: O(logn), Worst Case: O(logn)'''
2828

29-
def averagecase_complexity():
30-
return 'O(logn)'
31-
32-
def worstcase_complexity():
33-
return 'O(logn)'
34-
35-
# easily retrieve the source code of the sort function
29+
# easily retrieve the source code of the search function
3630
def get_code():
3731
import inspect
3832
return inspect.getsource(search)

0 commit comments

Comments
 (0)