suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
15
Sujet_bac/Pratique/BNS_2025/25-NSI-15/25-NSI-15.py
Normal file
15
Sujet_bac/Pratique/BNS_2025/25-NSI-15/25-NSI-15.py
Normal file
@@ -0,0 +1,15 @@
|
||||
def chercher(tab, x, i, j):
|
||||
'''Renvoie l'indice de x dans tab, si x est dans tab,
|
||||
None sinon.
|
||||
On suppose que tab est trié dans l'ordre croissant.'''
|
||||
if i > j:
|
||||
return None
|
||||
m = (i + j) // ...
|
||||
if ... < x:
|
||||
return chercher(tab, x, ... , ...)
|
||||
elif tab[m] > x:
|
||||
return chercher(tab, x, ... , ...)
|
||||
else:
|
||||
return ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user