X-Git-Url: https://git.piment-noir.org/?p=Algorithmic_C.git;a=blobdiff_plain;f=TP5%2Fexo4%2Fliste_chainee.c;h=b7fa6d07e3a3c72ba06015b20dca42c48b22ac35;hp=851e35428f6d63f1ad12b2805500501bbb79effd;hb=9861d3940b60068f12d4e5754eadab372453f37b;hpb=67b4409586ad416765bb6304cf50b576df64dfcb 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)