Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def bin_search(lst, _id):
  2. stub = len(lst) / 2
  3. if _id == lst[stub].id:
  4. return lst[index]
  5. elif _id > lst[stub].id:
  6. return bin_search(lst[stub:], _id)
  7. elif _id < lst[stub].id:
  8. return bin_search(lst[:stub], _id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement