Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fortierq authored Nov 22, 2024
1 parent de21b65 commit 3e23800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tp/5_tp5/5_tp5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ g.aretes[4][1] = g.aretes[5][2] = a(4, 5, 5);
On utilisera `G1` pour tester les fonctions suivantes.

3. Écrire une fonction `int n_aretes(graphe g)` renvoyant le nombre d'arêtes du graphe `g`.
4. Écrire une fonction `arete* aretes(graphe g)` renvoyant un tableau contenant toutes les arêtes du graphe `g`. On pourra renvoyer chaque arête en double.
4. Écrire une fonction `arete* aretes(graphe g)` renvoyant un tableau contenant toutes les arêtes du graphe `g`.

Le tri par insertion trie un tableau `t` en parcourant chaque élément `t[i]` et en le plaçant à sa place dans le sous-tableau trié `t[0]`, `t[1]`, ..., `t[i - 1]`. Pour le mettre à sa bonne position, on l'échange avec l'élément précédent tant que celui-ci est plus grand.
L'invariant suivant est conservé : à la fin de la $i$-ème itération, le sous-tableau `t[0]`, `t[1]`, ..., `t[i]` est trié.
Expand Down

0 comments on commit 3e23800

Please sign in to comment.