ajout images programme terminale + fichier python dichotomie recursive

This commit is contained in:
2024-09-30 10:52:24 +02:00
parent dff1e45de1
commit fc56c693c3
8 changed files with 195 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
def recherche(tab:list,x:int)-> bool:
if len(tab) == 0:
return False
m = len(tab) // 2
if tab[m] == x:
return True
elif tab [m] < x:
return recherche(tab[m+1 :],x)
else:
return recherche(tab[:m],x)