Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
binarySearch.py
#python 3.5.2 #binarySearch(list,key) def binarySearch(list,key): start=0 end=len(list)-1 found=0 while start<=end: mid=(start+end)//2 if list[mid]==key: found=1 break elif list[mid]>key: end=mid-1 else: start=mid+1 if found==1: print("Found @ ",mid) else: print("Not found") binarySearch([10,20,20,30,40,50,50,60],20)
run
|
edit
|
history
|
help
0
Variables mutables e inmutables
guessgame
Assignment-2b
hi
Reverse function
reverse words
Circular progress bar tkinter
Lesson4
intresting pattern
Palindrome using recursion