Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bin_search(lst, _id):
- stub = len(lst) / 2
- if _id == lst[stub].id:
- return lst[index]
- elif _id > lst[stub].id:
- return bin_search(lst[stub:], _id)
- elif _id < lst[stub].id:
- return bin_search(lst[:stub], _id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement