TP6: Fix to the n ary tree.
[Algorithmic_C.git] / TP6 / arbres / arbre_n_aire / arbre_n_aire.c
index 163412d741e170032ee2d889e77ef1e235a51588..678451771dfdc3b44a187b89d5f8be012fc98a2d 100644 (file)
@@ -61,7 +61,7 @@ NOEUD *insere(NOEUD * p, char *mot, int i)
     if (p == NULL) {
        return insere_fin(mot, i);
     } else if (p->lettre == mot[i]) {
-       if (mot[i] == '\0') {
+       if (mot[i] != '\0') {
            p->fils = insere(p->fils, mot, i + 1);
        } else {
            printf("The word is already here\n");
@@ -76,7 +76,6 @@ NOEUD *insere(NOEUD * p, char *mot, int i)
     return p;
 }
 
-
 /*****************************************************************************/
 /* Affichage par ordre alphabetique de tous les mots stockes dans l'arbre    */
 void affiche(NOEUD * p, char *mot, int i)