1234567891011
left, right =0, len(array) - 1while left <= right: mid = left + (right - left)/2 if array[mid] == target: //find the target break or return result elif array[mid] < target: left = mid + 1 else: right = mid - 1
sanwanliu
Posts
44
Categories
5
Tags
18
算法
Update your browser to view this website correctly. Update my browser now
×