suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
BIN
Sujet_bac/Pratique/BNS_2025/25-NSI-37/25-NSI-37.pdf
Normal file
BIN
Sujet_bac/Pratique/BNS_2025/25-NSI-37/25-NSI-37.pdf
Normal file
Binary file not shown.
17
Sujet_bac/Pratique/BNS_2025/25-NSI-37/25-NSI-37.py
Normal file
17
Sujet_bac/Pratique/BNS_2025/25-NSI-37/25-NSI-37.py
Normal file
@@ -0,0 +1,17 @@
|
||||
def tri_insertion(tab):
|
||||
'''Trie le tableau tab par ordre croissant
|
||||
en appliquant l'algorithme de tri par insertion'''
|
||||
n = len(tab)
|
||||
for i in range(1, n):
|
||||
valeur_insertion = ...
|
||||
# la variable j sert à déterminer
|
||||
# où placer la valeur à ranger
|
||||
j = ...
|
||||
# tant qu'on n'a pas trouvé la place de l'élément à
|
||||
# insérer on décale les valeurs du tableau vers la droite
|
||||
while j > ... and valeur_insertion < tab[...]:
|
||||
tab[j] = tab[j-1]
|
||||
j = ...
|
||||
tab[j] = ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user