Skip to content

Commit 0900857

Browse files
committed
Update de l'algorithm
1 parent a267ab4 commit 0900857

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

Algo Tri-insertion/algorithm.algo

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
// Correspond à la fonction Trouve disponible
2-
FONCTION ENTIER RechercheFilm(Chaine: nomRecherche)
2+
FONCTION Tri-insertion (Tableau T)
33
VARIABLE
4-
ENTIER: i <- 0
5-
BOOLEAN: nonTrouve <- VRAI
4+
ENTIER: x <- T[i]
5+
j ← i
66
DEBUT
7-
FAIRE
8-
SI noms[i] = nomRecherche ALORS
9-
nonTrouve = FAUX
10-
SINON
11-
i <- i + 1
12-
FINSI
13-
TANTQUE nonTrouve Et i < NB_FILM
14-
15-
SI nonTrouve ALORS
16-
i <- NULL
17-
FINSI
18-
7+
TANTQUE j > 0 et T[j-1] > x
8+
T[j] <- T[j-1]
9+
j <- j-1
10+
T[j] <- x
1911
Retourne i
2012
FIN
2113
FINFONCTION

0 commit comments

Comments
 (0)