diff --git a/arbre.c b/arbre.c new file mode 100644 index 0000000..2c4db25 --- /dev/null +++ b/arbre.c @@ -0,0 +1,55 @@ +#include +#include +#include + + +typedef struct arbre{ + char val; + char *suite[26]; + bool finmot; //1 si fin de mot +}Arbre; + +typedef struct dico { + Arbre *alpha[26]; +}Dico; + + + + + + +void arbre_vide(struct arbre ** pt_arbre) +{ + *pt_arbre = NULL; +} + +bool est_vide(struct arbre *arbre) +{ + return arbre==NULL; +} + +bool fin_de_mot(struct arbre *arbre) +{ + return arbre->finmot; +} + +void cons_dico(struct dico **pt_dico,char val){ + struct dico *mondico=malloc(sizeof(struct dico)); + mondico->alpha[val-97]=val; // (ascii)->a = 97 + (*pt_dico)=mondico; +} + +void cons_arbre(struct arbre **pt_arbre,char val){ + struct arbre *monarbre=malloc(sizeof(struct arbre)); + mondico->alpha[val-97]=val; // (ascii)->a = 97 + +} + +int main (){ + + + + + + return 0; +} -- libgit2 0.21.2