用python实现二分查找
def bisearch(elems, key):
low = 0
high = len(elems) - 1
while low <= high:
mid = (low + high)//2
if key == elems[mid].key:
return elems[mid].value
if key < elems[mid].key:
high = mid - 1
else:
low = mid + 1