Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
quck sort
x=[1,2,3,5,6,7,8,9,10] s=0 e=len(x)-1 mid=(0+len(x)-1)//2 ele=int(input()) for j in range(0,len(x)): mid=(s+e)//2 if x[mid]==ele: print("Element ("+str(x[mid])+") found at posititon ="+str(mid)) break elif ele>x[mid]: s=mid+1 e=len(x)-1 elif ele<x[mid]: s=0 e=mid-1 if x[mid]!=ele: print("Element not found")
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
hi
Find numbers with given sum of digits
Infinite Fibonacci generator
playing around with python
Simulare
Primes finding algorithm
PYTHON 3 ÖDEV :)
GINGERMANZ
Grupo1
5
stackse - search stackoverflow differently
Please log in to post a comment.