mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-30 04:36:08 -04:00
Update binary_search.py
This commit is contained in:
parent
2396654457
commit
398c10877c
@ -26,7 +26,7 @@ def binary_search_iterative(array, item):
|
|||||||
lower, higher = 0, len(array)
|
lower, higher = 0, len(array)
|
||||||
|
|
||||||
while lower < higher:
|
while lower < higher:
|
||||||
mid = (highe r+ lower) // 2
|
mid = (higher + lower) // 2
|
||||||
|
|
||||||
if array[mid] == item:
|
if array[mid] == item:
|
||||||
return mid
|
return mid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user