Commit a0f256f7 by BellCodeEditor

save project

parent 37c1d633
Showing with 16 additions and 3 deletions
......@@ -8,5 +8,19 @@ num = random.choice(alist)
def binary_search(alist,num):
z=0
x=9
n=len(a)-1
\ No newline at end of file
x=9
while True:
v=(z+x)//2
b=alist[v]
if b==num:
print("hhhhhh")
print(v)
break
elif b<9:
z=v+1
else:
x=v-1
if z>x:
print("cao")
break
binary_search(alist,num)
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