mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-13 08:51:37 +08:00
Implement floor division (#8)
This commit is contained in:

committed by
Yangshun Tay

parent
316c6f3e5b
commit
ead0e74674
@ -2,7 +2,7 @@ def binary_search(arr, target):
|
||||
left = 0;
|
||||
right = len(arr) - 1
|
||||
while left < right:
|
||||
mid = left + (right - left) / 2;
|
||||
mid = left + (right - left) // 2;
|
||||
if arr[mid] == target:
|
||||
return mid
|
||||
elif arr[mid] < target:
|
||||
|
Reference in New Issue
Block a user