From 5e43fa773317f401705a2e780dd6bfde80df59fa Mon Sep 17 00:00:00 2001 From: rsSimonin Date: Mon, 25 Mar 2019 16:05:36 +0100 Subject: [PATCH] arbre.c --- arbre.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+), 0 deletions(-) create mode 100644 arbre.c 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