suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
16
Sujet_bac/Pratique/BNS_2025/25-NSI-13/25-NSI-13.py
Normal file
16
Sujet_bac/Pratique/BNS_2025/25-NSI-13/25-NSI-13.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def insere(tab, a):
|
||||
"""
|
||||
Insère l'élément a (int) dans le tableau tab (list)
|
||||
trié par ordre croissant à sa place et renvoie le
|
||||
nouveau tableau.
|
||||
"""
|
||||
tab_a = [ a ] + tab # nouveau tableau contenant a
|
||||
# suivi des éléments de tab
|
||||
i = 0
|
||||
while i < ... and a > ...:
|
||||
tab_a[i] = ...
|
||||
tab_a[i+1] = a
|
||||
i = ...
|
||||
return tab_a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user