From: Jérôme Benoit Date: Sun, 2 Apr 2017 16:09:14 +0000 (+0200) Subject: TP5: Fix a FIXME in a linked list function X-Git-Url: https://git.piment-noir.org/?p=Algorithmic_C.git;a=commitdiff_plain;h=9861d3940b60068f12d4e5754eadab372453f37b TP5: Fix a FIXME in a linked list function Signed-off-by: Jérôme Benoit --- diff --git a/TP5/exo4/liste_chainee.c b/TP5/exo4/liste_chainee.c index 851e354..b7fa6d0 100644 --- a/TP5/exo4/liste_chainee.c +++ b/TP5/exo4/liste_chainee.c @@ -80,14 +80,9 @@ void visualiser_iter(Liste L) void _visualiser_rec(Liste L, int compteur) { if (L != NULL) { - /* FIXME: suboptimal printing to stdout, put this code path outside the recursion */ - if (compteur == 0) - printf("--Debut--\n"); printf("L[%d]->value=%d\n", compteur, L->valeur); compteur++; _visualiser_rec(L->suivant, compteur); - if (compteur == (longueur_rec(L) - 1)) - printf("--Fin--\n"); } } @@ -96,7 +91,9 @@ void visualiser_rec(Liste L) { int compteur = 0; + printf("--Debut--\n"); _visualiser_rec(L, compteur); + printf("--Fin--\n"); } bool rechercher_iter(element e, Liste L)