二分法查找(前提序列有序)

#encoding=utf-8
def BinarySearch(arr,aimNum):
    start = 0
    end = len(arr)-1
    mid = int((start+end)/2)
    while True:
        if aimNum>arr[mid]:
            start = mid+1
            mid = int ((start + end) / 2)
        elif aimNum

你可能感兴趣的:(二分法查找(前提序列有序))