Flo fct rechercher
This commit is contained in:
parent
742877f86b
commit
87225ba14e
1 changed files with 16 additions and 0 deletions
|
|
@ -66,4 +66,20 @@ void free_arbre(arbre a)
|
|||
free_arbre(fils_droit(a));
|
||||
free(a);
|
||||
}
|
||||
}
|
||||
|
||||
char *rechercher (arbre a, char c, char*s)
|
||||
{
|
||||
if (racine(a)==c)
|
||||
{
|
||||
return s ;
|
||||
}
|
||||
if (!est_arbre_vide(fils_gauche(a)))
|
||||
{
|
||||
rechercher (fils_gauche(a),c,s+'0') ;
|
||||
}
|
||||
if (!est_arbre_vide(fils_droit(a)))
|
||||
{
|
||||
rechercher (fils_droit(a),c,s+'1') ;
|
||||
}
|
||||
}
|
||||
Reference in a new issue