Commit 4a1bc8c3105f2846ef4c616e5f06fe3570bb6192
1 parent
0e453bf3
affichage free et implementation fini, manque les caractère speciaux
Showing
1 changed file
with
1 additions
and
15 deletions
Show diff stats
arbre.c
... | ... | @@ -59,7 +59,6 @@ void ajout_mot(struct arbre **arbrecourant,char *mot,int i){ |
59 | 59 | monarbre->suite[j]=NULL; |
60 | 60 | } |
61 | 61 | *arbrecourant=monarbre; |
62 | -// printf("%c\n",(*pt_arbre)->val); | |
63 | 62 | } |
64 | 63 | i++; |
65 | 64 | ajout_mot(&((*arbrecourant)->suite[calculcase(mot[i])]),mot,i); |
... | ... | @@ -72,20 +71,7 @@ void charger_arbre(FILE *fp, struct dico **ppt_dico) |
72 | 71 | ini_dico(*ppt_dico); |
73 | 72 | while (fscanf(fp, "%s", mot)==1){ |
74 | 73 | printf("mot:%s\n\n\n",mot); |
75 | - | |
76 | 74 | printf("\nlettre:%c\n",mot[0]); |
77 | - /* | |
78 | - if( (*ppt_dico)->alpha[calculcase(mot[0])]==NULL){ | |
79 | - printf("creation 1er niveau\n"); | |
80 | - Arbre *arbrecourant=malloc(sizeof(struct arbre)); | |
81 | - arbrecourant->val=mot[0]; | |
82 | - arbrecourant->finmot=false; | |
83 | - for(int j=0;j<26;j++){ | |
84 | - arbrecourant->suite[j]=NULL; | |
85 | - } | |
86 | - (*ppt_dico)->alpha[calculcase(mot[0])]=arbrecourant; | |
87 | - }*/ | |
88 | - //int index=1; | |
89 | 75 | ajout_mot(&((*ppt_dico)->alpha[calculcase(mot[0])]),mot,0); |
90 | 76 | } |
91 | 77 | return ; |
... | ... | @@ -99,7 +85,6 @@ void free_arbre(struct arbre *pt_arbre){ |
99 | 85 | for(int i=0;i<26;i++){ |
100 | 86 | free_arbre((pt_arbre->suite[i])); |
101 | 87 | } |
102 | - printf("lettre:%c\n",pt_arbre->val); | |
103 | 88 | free(pt_arbre); |
104 | 89 | } |
105 | 90 | |
... | ... | @@ -119,6 +104,7 @@ void affiche_arbre(struct arbre *arbre){ |
119 | 104 | if(arbre==NULL){ |
120 | 105 | return ; |
121 | 106 | } |
107 | + printf("%c:",arbre->val); | |
122 | 108 | for(int i=0;i<26;i++){ |
123 | 109 | affiche_arbre(arbre->suite[i]); |
124 | 110 | } | ... | ... |