All checks were successful
continuous-integration/drone/push Build is passing
13 lines
227 B
Python
13 lines
227 B
Python
def dichotomie(liste, x):
|
|
g = 0
|
|
d = len(L)-1
|
|
while g <= l:
|
|
m = (g + d) // 2
|
|
if L[m] < x:
|
|
g = m
|
|
elif L[m] > x:
|
|
d = m
|
|
else:
|
|
return m
|
|
return None
|