Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Hello world
init constructor
Insert a sequence of same numbers, unpacking
PyEnum
Implementation of Singleton pattern
First python practice
PYTHON 3
,..........(༎ຶ ෴ ༎ຶ)Hello my name.....(╯︵╰,).,
Variables mutables e inmutables
PyNamedTuple
Please log in to post a comment.