Commit 66f4186c by BellCodeEditor

save project

parent d5afc004
Showing with 5 additions and 4 deletions
......@@ -9,12 +9,12 @@ def binary_search(alist,num):
high=len(alist)-1
while low <= high:
mid = (low+high) // 2
num = alist[mid]
if num == num:
guess = alist[mid]
if guess == num:
return mid
break
elif num < num:
elif guess < num:
low = mid+1
elif num > num:
elif guess > num:
high = mid-1
print(binary_search(alist,1))
\ No newline at end of file
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