Skip to content
Snippets Groups Projects
Commit 7d35050c authored by Abdul-Malik Elmurzaev's avatar Abdul-Malik Elmurzaev
Browse files

correction fonction rech, je n'avais pas bien lu la consigne

parent 83f231d0
Branches
1 merge request!5fonctions jusqu'à chemin2 incluse sont vérifiées. Aucune memory leak
......@@ -118,15 +118,15 @@ void detruire(listeg lst){
}
}
listeg rech(listeg lst, void *x, int(*comp)(void *, void *)){
listeg resultat = listegnouv();
listeg copy = lst;
while(copy != NULL){
if( comp(x, copy->val) ){
return lst;
}else{
copy = copy->suiv;
resultat = adjqueue(resultat, copy->val);
}
copy = copy->suiv;
}
return NULL;
return resultat;
}
////////////////////////////////////////
......@@ -292,7 +292,8 @@ void adjRelation(Relations g, char *nom1, char *nom2, rtype id){
// 4.1 listes de relations
listeg en_relation(Relations g, char *x){
return NULL;
listeg liste = g->listDeRelations;
liste = rech(liste, x, compSommet);
}
listeg chemin2(Relations g, char *x, char *y){
return NULL;
......@@ -307,8 +308,9 @@ bool ont_lien_parente(Relations g, char *x, char *y){
// PRE CONDITION: les sommets correspondants � x et y sont de type PERSONNE
// PRE CONDITION: strcmp(x,y)!=0
bool se_connaissent(Relations g, char *x, char *y){
return false;
return 0;
}
// PRE CONDITION: les sommets correspondants � x et y sont de type PERSONNE
// PRE CONDITION: strcmp(x,y)!=0
bool se_connaissent_proba(Relations g, char *x, char *y){
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment