SHARE
TWEET

Untitled

a guest Mar 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def bin_search(lst, index):
  2.     stub = len(lst) / 2
  3.     if index == lst[stub].id:
  4.         return lst[index]
  5.     elif index > stub:
  6.         return bin_search(lst[stub:], index - stub)
  7.     elif index < stub:
  8.         return bin_search(lst[:stub], index)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top