Commit 8c0bf47c by BellCodeEditor

save project

parent 5f7f53d9
Showing with 5 additions and 4 deletions
......@@ -9,13 +9,14 @@ num = random.choice(alist)
def binary_search(alist,num):
while mi<mx:
mid=(mi+mx)//2
gis=num_list[mid]
gis=alist[mid]
if num1==gis:
print(mid)`7`
break
return mid
elif mun>gis:
mi=mid+1
else:
mx=mid-1
return None
num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21]
num1=20
mi=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment