Skip to content

Commit 58a27b7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 49be153 commit 58a27b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

searches/binary_search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def insort_right(
183183
# It works by repeatedly dividing in half the portion of the list that could contain the item,
184184
# until you've narrowed the possible locations to just one.
185185

186+
186187
def binary_search(arr, x):
187188
"""
188189
Perform a binary search to find the element `x` in the sorted list `arr`.
@@ -213,6 +214,7 @@ def binary_search(arr, x):
213214
# Return -1 if element is not present in the list
214215
return -1
215216

217+
216218
def binary_search_std_lib(sorted_collection: list[int], item: int) -> int:
217219
"""Pure implementation of a binary search algorithm in Python using stdlib
218220

0 commit comments

Comments
 (0)