nsi:premiere:tableau:recherche:comparaison
Différences
Ci-dessous, les différences entre deux révisions de la page.
| nsi:premiere:tableau:recherche:comparaison [2022/03/18 16:27] – créée goupillwiki | nsi:premiere:tableau:recherche:comparaison [2023/03/07 14:40] (Version actuelle) – goupillwiki | ||
|---|---|---|---|
| Ligne 9: | Ligne 9: | ||
| <code python> | <code python> | ||
| from random import randrange | from random import randrange | ||
| - | from time import | + | from time import |
| # n' | # n' | ||
| Ligne 22: | Ligne 22: | ||
| # cas séquentiel : | # cas séquentiel : | ||
| - | depart = time_ns() | + | depart = chrono() |
| i = recherche_sequentielle(T, | i = recherche_sequentielle(T, | ||
| - | fin = time_ns() | + | fin = chrono() |
| duree = fin - depart | duree = fin - depart | ||
| print(f" | print(f" | ||
| # cas dichotomique | # cas dichotomique | ||
| - | depart = time_ns() | + | depart = chrono() |
| T.sort() | T.sort() | ||
| - | fin = time_ns() | + | fin = chrono() |
| duree = fin - depart | duree = fin - depart | ||
| print(f" | print(f" | ||
| - | depart = time_ns() | + | depart = chrono() |
| i = recherche_dichotomique(T, | i = recherche_dichotomique(T, | ||
| - | fin = time_ns() | + | fin = chrono() |
| print(f" | print(f" | ||
| </ | </ | ||
nsi/premiere/tableau/recherche/comparaison.1647617233.txt.gz · Dernière modification : de goupillwiki
