diff --git a/arbre_de_codage/arbre_binaire.c b/arbre_de_codage/arbre_binaire.c index e932c74..c35165a 100644 --- a/arbre_de_codage/arbre_binaire.c +++ b/arbre_de_codage/arbre_binaire.c @@ -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') ; + } } \ No newline at end of file