diff --git a/2A/Algo/tp/C/2_tp/bin/exe b/2A/Algo/tp/C/2_tp/bin/exe index d8c5a78..afd6579 100755 Binary files a/2A/Algo/tp/C/2_tp/bin/exe and b/2A/Algo/tp/C/2_tp/bin/exe differ diff --git a/2A/Algo/tp/C/2_tp/src/reseau.c b/2A/Algo/tp/C/2_tp/src/reseau.c index 531a4fc..a144357 100644 --- a/2A/Algo/tp/C/2_tp/src/reseau.c +++ b/2A/Algo/tp/C/2_tp/src/reseau.c @@ -16,11 +16,13 @@ Booleen estReseauVide(Reseau r) { void afficherReseau(Reseau r) { Noeud * tmp = r; + Arc * tmpa; while(tmp != NULL) { printf("%d :\n", tmp->num); - while(tmp->listeArcs != NULL) { - printf("\t-> %d \n", tmp->listeArcs->ext->num); - tmp->listeArcs = tmp->listeArcs->suiv; + tmpa = tmp->listeArcs; + while(tmpa != NULL) { + printf("\t-> %d \n", tmpa->ext->num); + tmpa = tmpa->suiv; } tmp = tmp->suiv; } @@ -96,29 +98,23 @@ CodeRetour ajouterArc(Reseau r, int dep, int arr) { return OK; } -CodeRetour supprimerArc(Reseau r, int dep, int arr) { - Noeud * ptDep, * ptArr; - Arc * tmpa, * tmp; - ptDep = rechPtSurNoeud(r, dep); - if(ptDep == NULL) return PB_NOEUD_DEP_NON_EXISTANT; - ptArr = rechPtSurNoeud(r, arr); - if(ptArr == NULL) return PB_NOEUD_ARR_NON_EXISTANT; +/// precondition d'usage, cette fonction ne peut etre appelé que si on est sur que l'arc n'est pas vide. +CodeRetour supprimerPtArc(Noeud *ptDep, Noeud *ptArr) { + Arc * tmpa = NULL, * tmp = NULL; - if(rechercherArcPt(ptDep, ptArr) == NON) return PB_ARC_NON_EXISTANT; - - tmpa = ptDep->listeArcs; - - if(tmpa->ext == arr) { + if(ptDep->listeArcs->ext == ptArr) { + tmpa = ptDep->listeArcs; ptDep->listeArcs = tmpa->suiv; + free(tmpa); return OK; } else { tmpa = ptDep->listeArcs->suiv; tmp = ptDep->listeArcs; while(tmpa != NULL) { - if(tmpa->ext == arr) { + if(tmpa->ext == ptArr) { tmp->suiv = tmpa->suiv; - ptDep->listeArcs = tmp; + free(tmpa); return OK; } tmpa = tmpa->suiv; @@ -127,3 +123,37 @@ CodeRetour supprimerArc(Reseau r, int dep, int arr) { } return NON; } + +CodeRetour supprimerArc(Reseau r, int dep, int arr) { + Noeud * ptDep, * ptArr; + ptDep = rechPtSurNoeud(r, dep); + if(ptDep == NULL) return PB_NOEUD_DEP_NON_EXISTANT; + ptArr = rechPtSurNoeud(r, arr); + if(ptArr == NULL) return PB_NOEUD_ARR_NON_EXISTANT; + + if(rechercherArcPt(ptDep, ptArr) == NON) return PB_ARC_NON_EXISTANT; + + return supprimerPtArc(ptDep, ptArr); +} + +CodeRetour supprimerArcs(Arc * arcSurNoeud) { + Arc *tmp = arcSurNoeud; + while(tmp != NULL) { + arcSurNoeud = arcSurNoeud->suiv; + free(tmp); + tmp = arcSurNoeud; + } + + return OK; +} + +CodeRetour supprimerNoeud(Reseau r, int noeud) { + Noeud * ptSurNoeud; + CodeRetour codeRetour; + ptSurNoeud = rechPtSurNoeud(r, noeud); + if(ptSurNoeud == NULL) return PB_NOEUD_NON_EXISTANT; + + codeRetour = supprimerArcs(ptSurNoeud->listeArcs); + afficheMessageCodeRetour(codeRetour); + return OK; +} diff --git a/2A/Algo/tp/C/2_tp/src/reseau.h b/2A/Algo/tp/C/2_tp/src/reseau.h index e56f89f..7844309 100644 --- a/2A/Algo/tp/C/2_tp/src/reseau.h +++ b/2A/Algo/tp/C/2_tp/src/reseau.h @@ -27,6 +27,7 @@ CodeRetour ajouterNoeud(Reseau * ptr, int num); CodeRetour rechercherArc(Reseau r, int dep, int arr); CodeRetour ajouterArc(Reseau r, int dep, int arr); CodeRetour supprimerArc(Reseau r, int dep, int arr); +CodeRetour supprimerNoeud(Reseau r, int noeud); diff --git a/2A/Algo/tp/C/2_tp/src/testReseau.c b/2A/Algo/tp/C/2_tp/src/testReseau.c index c6a870e..739d897 100644 --- a/2A/Algo/tp/C/2_tp/src/testReseau.c +++ b/2A/Algo/tp/C/2_tp/src/testReseau.c @@ -7,7 +7,7 @@ void testReseau(void) { Reseau a = creerReseauVide(); Booleen boolA; - CodeRetour codeA; + CodeRetour codeA, sup; boolA = estReseauVide(a); if(boolA == TRUE) printf("OK\n"); else printf("Pas OK\n"); @@ -33,7 +33,11 @@ void testReseau(void) { ajouterArc(a, 3, 3); ajouterArc(a, 3, 2); afficherReseau(a); - supprimerArc(a, 1, 2); + sup = supprimerArc(a, 1, 2); + afficheMessageCodeRetour(sup); + afficherReseau(a); + sup = supprimerNoeud(a, 2); + afficheMessageCodeRetour(sup); afficherReseau(a); } diff --git a/2A/Algo/tp/aide_doxygen.pdf b/2A/Algo/tp/aide_doxygen.pdf new file mode 100644 index 0000000..25e5533 Binary files /dev/null and b/2A/Algo/tp/aide_doxygen.pdf differ diff --git a/2A/Analyse/SyntheseExosUML/ExoSiteWeb2.pdf b/2A/Analyse/SyntheseExosUML/ExoSiteWeb2.pdf new file mode 100644 index 0000000..fef5872 Binary files /dev/null and b/2A/Analyse/SyntheseExosUML/ExoSiteWeb2.pdf differ diff --git a/2A/Droit/TD/DroitTD3.pdf b/2A/Droit/TD/DroitTD3.pdf new file mode 100644 index 0000000..7c435e0 Binary files /dev/null and b/2A/Droit/TD/DroitTD3.pdf differ diff --git a/2A/Droit/TD/TD3_MUZARD_Thomas.pdf b/2A/Droit/TD/TD3_MUZARD_Thomas.pdf new file mode 100644 index 0000000..9520e2a Binary files /dev/null and b/2A/Droit/TD/TD3_MUZARD_Thomas.pdf differ diff --git a/2A/Innovation/Cours/Management de l’innovation 1.pptx b/2A/Innovation/Cours/Management de l’innovation 1.pptx new file mode 100644 index 0000000..fe80be8 Binary files /dev/null and b/2A/Innovation/Cours/Management de l’innovation 1.pptx differ diff --git a/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.docx b/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.docx index faf345c..193d060 100644 Binary files a/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.docx and b/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.docx differ diff --git a/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.pdf b/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.pdf new file mode 100644 index 0000000..ac55391 Binary files /dev/null and b/2A/PPP/s1/Communication_professionnelle/LettreMotivationAnnonce.pdf differ diff --git a/2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf b/2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf new file mode 100644 index 0000000..f3615e6 Binary files /dev/null and b/2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf differ diff --git a/2A/PPP/s1/Communication_professionnelle/lettreMotiv.docx b/2A/PPP/s1/Communication_professionnelle/lettreMotiv.docx new file mode 100644 index 0000000..8bd0bee Binary files /dev/null and b/2A/PPP/s1/Communication_professionnelle/lettreMotiv.docx differ diff --git a/2A/PPP/s1/Communication_professionnelle/lettreSTM.docx b/2A/PPP/s1/Communication_professionnelle/lettreSTM.docx new file mode 100644 index 0000000..c974e3d Binary files /dev/null and b/2A/PPP/s1/Communication_professionnelle/lettreSTM.docx differ diff --git a/2A/PPP/s1/Communication_professionnelle/lettreSTM.pdf b/2A/PPP/s1/Communication_professionnelle/lettreSTM.pdf new file mode 100644 index 0000000..71c8228 Binary files /dev/null and b/2A/PPP/s1/Communication_professionnelle/lettreSTM.pdf differ diff --git a/2A/PPP/s1/PPP/Savoir expliquer son stage idéal-slideshow.pdf b/2A/PPP/s1/PPP/Savoir expliquer son stage idéal-slideshow.pdf new file mode 100644 index 0000000..31e67bf Binary files /dev/null and b/2A/PPP/s1/PPP/Savoir expliquer son stage idéal-slideshow.pdf differ