Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bin_search2(arr,value, left, right):
- mid = int((left + right) / 2)
- guess = arr[mid]
- if guess == value:
- return mid
- if guess < value:
- left = mid + 1
- return bin_search2(arr,value, left, right)
- if guess > value:
- right = mid - 1
- return bin_search2(arr,value, left, right)
- return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement