TP4 dicho inversion
This commit is contained in:
parent
07df5749a3
commit
7606f6e7be
|
@ -74,7 +74,7 @@ def dicho(l, a, b, x): # Geoffrey
|
||||||
assert(type(a) == type(b) == int), "a et b doivent être des ints"
|
assert(type(a) == type(b) == int), "a et b doivent être des ints"
|
||||||
assert(0 <= a < b <= len(l)), "Il faut que 0 ≤ a < b ≤ len(l)"
|
assert(0 <= a < b <= len(l)), "Il faut que 0 ≤ a < b ≤ len(l)"
|
||||||
|
|
||||||
a = d
|
d = a
|
||||||
f = b - 1
|
f = b - 1
|
||||||
while d < f:
|
while d < f:
|
||||||
m = (d+f)//2
|
m = (d+f)//2
|
||||||
|
|
Reference in a new issue