1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
typedef int sommet;
typedef struct chainon
{
sommet st;
struct chainon * suivant ;
} Couple;
typedef Couple * liste;
typedef struct
{
liste a[n_max];
int n;
}graphe;
void parcours_en_prof(graphe g)
{
int marquage marque[n_max];
sommet x;
for (x=0 ; x<g.n ; x++)
marque[x] =0;
for(x=0 ; x < g.n ; x++)
if(!marque[x])
rech_prof(g,marque,x);
}
void rech_prof(graphe g, marquage marque,sommet x)
{
liste p;
marque[x] = 1;
p=g.a[x];
while(p != NULL)
{
if(!marque[p->st])
rech_prof(g,marque,p->st);
p=p->suivant;
}
} |
Partager